]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/template/template.c
Merge branch 'master' of https://github.com/jackhumbert/tmk_keyboard
[qmk_firmware.git] / quantum / template / template.c
1 #include "%KEYBOARD%.h"
2
3 __attribute__ ((weak))
4 void matrix_init_user(void) {
5         // leave this function blank - it can be defined in a keymap file
6 };
7
8 __attribute__ ((weak))
9 void matrix_scan_user(void) {
10         // leave this function blank - it can be defined in a keymap file
11 }
12
13 __attribute__ ((weak))
14 void process_action_user(keyrecord_t *record) {
15         // leave this function blank - it can be defined in a keymap file
16 }
17
18 __attribute__ ((weak))
19 void led_set_user(uint8_t usb_led) {
20         // leave this function blank - it can be defined in a keymap file
21 }
22
23 void matrix_init_kb(void) {
24         // put your keyboard start-up code here
25         // runs once when the firmware starts up
26
27         matrix_init_user();
28 }
29
30 void matrix_scan_kb(void) {
31         // put your looping keyboard code here
32         // runs every cycle (a lot)
33
34         matrix_scan_user();
35 }
36
37 void process_action_kb(keyrecord_t *record) {
38         // put your per-action keyboard code here
39         // runs for every action, just before processing by the firmware
40
41         process_action_user(record);
42 }
43
44 void led_set_kb(uint8_t usb_led) {
45         // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
46
47         led_set_user(usb_led);
48 }