]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/kuchosauronad0/template.c
clean up quantum.c (#7485)
[qmk_firmware.git] / users / kuchosauronad0 / template.c
1 #include "template.h"
2
3
4 // Add reconfigurable functions here, for keymap customization
5 // This allows for a global, userspace functions, and continued
6 // customization of the keymap.  Use _keymap instead of _user
7 // functions in the keymaps
8 __attribute__ ((weak))
9 void matrix_init_keymap(void) {}
10
11 // Call user matrix init, then call the keymap's init function
12 void matrix_init_user(void) {
13   matrix_init_keymap();
14 }
15
16
17 __attribute__ ((weak))
18 void matrix_scan_keymap(void) {}
19
20 // No global matrix scan code, so just run keymap's matix
21 // scan function
22 __attribute__ ((weak))
23 void matrix_scan_user(void) {
24   matrix_scan_keymap();
25 }
26
27
28 __attribute__ ((weak))
29 bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
30   return true;
31 }
32
33 // Defines actions tor my global custom keycodes. Defined in drashna.h file
34 // Then runs the _keymap's recod handier if not processed here,
35 // And use "NEWPLACEHOLDER" for new safe range
36 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
37
38   switch (keycode) {
39   case KC_MAKE:
40     if (!record->event.pressed) {
41       SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
42 #if  (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
43         ":dfu"
44 #elif defined(BOOTLOADER_HALFKAY)
45         ":teensy"
46 #elif defined(BOOTLOADER_CATERINA)
47         ":avrdude"
48 #endif
49         SS_TAP(X_ENTER));
50     }
51     return false;
52     break;
53
54   case VRSN:
55     if (record->event.pressed) {
56       SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
57     }
58     return false;
59     break;
60   }
61   return process_record_keymap(keycode, record);
62 }
63
64
65 __attribute__ ((weak))
66 uint32_t layer_state_set_keymap (uint32_t state) {
67   return state;
68 }
69
70 uint32_t layer_state_set_user (uint32_t state) {
71   return layer_state_set_keymap (state);
72 }
73
74
75
76 __attribute__ ((weak))
77 void led_set_keymap(uint8_t usb_led) {}
78
79 void led_set_user(uint8_t usb_led) {
80    led_set_keymap(usb_led);
81 }
82
83
84
85 __attribute__ ((weak))
86 void suspend_power_down_keymap(void) {}
87
88 void suspend_power_down_user(void)
89 {
90     suspend_power_down_keymap();
91 }
92
93
94
95 __attribute__ ((weak))
96 void suspend_wakeup_init_keymap(void) {}
97
98 void suspend_wakeup_init_user(void)
99 {
100   suspend_wakeup_init_keymap();
101   #ifdef KEYBOARD_ergodox_ez
102   wait_ms(10);
103   #endif
104 }
105
106
107
108 __attribute__ ((weak))
109 void startup_keymap(void) {}
110
111 void startup_user (void) {
112   #ifdef RGBLIGHT_ENABLE
113     matrix_init_rgb();
114   #endif //RGBLIGHT_ENABLE
115   startup_keymap();
116 }
117
118
119
120 __attribute__ ((weak))
121 void shutdown_keymap(void) {}
122
123 void shutdown_user (void) {
124   shutdown_keymap();
125 }