aboutsummaryrefslogtreecommitdiff
path: root/users/drashna/template.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-11-20 12:37:24 -0800
committerGitHub <noreply@github.com>2019-11-20 12:37:24 -0800
commiteb91c962886b1bb52c2d457a574cba09e2a8b0f0 (patch)
tree20f3d49671b6d42ca1edf285431e3e4120551228 /users/drashna/template.c
parent8e8986b2506ca4cdd2339a441314a0838e3a4329 (diff)
downloadqmk_firmware-eb91c962886b1bb52c2d457a574cba09e2a8b0f0.tar.gz
qmk_firmware-eb91c962886b1bb52c2d457a574cba09e2a8b0f0.zip
[Keymap] All about (ARM) RGB and OLEDs (drashna keymaps) (#7354)
* Add Kyria Keymap * Enable all RGBLIGHT Animations for ARM and high capacity AVR * Reduce GNUC version for __has_include * Cleanup Ortho 4x12 Community layout * Update Collide 39 keymap * Cleanup Keymaps * Enable full 30 LEDs for Ergodox * Change EEPROM Load timing * Use RGB Matrix on Planck Rev6 * Use correct keymap swap * Enable everything for ARM * Only enable rgb sleep on avr until crash is fixed * Add additional Kyria keymap config * Overhaul Kyria OLED display * Improve kyria keymap based on usage * Minor tweaks to rules * Update OLED code to truncate properly * Fix RGB Light layer indication * Switch all of biton32 to get_highest_layer function * Fix OLED Keylogger display * Run qmk cformat over all of my user files * Slight tweak to kyria based on usage * Move around LALT_T config * Add comments about base wrappers to keymaps * Another cformat pass * Temp fix for VUSB boards and NKRO * Convert tabs to spaces in rules.mk files * Only enable RGBLight if it's enabled * Add Encoder Flip setting * Update OLED font file
Diffstat (limited to 'users/drashna/template.c')
-rw-r--r--users/drashna/template.c130
1 files changed, 44 insertions, 86 deletions
diff --git a/users/drashna/template.c b/users/drashna/template.c
index d90e6bdec..833447daa 100644
--- a/users/drashna/template.c
+++ b/users/drashna/template.c
@@ -1,124 +1,82 @@
1#include "template.h" 1#include "template.h"
2 2
3
4// Add reconfigurable functions here, for keymap customization 3// Add reconfigurable functions here, for keymap customization
5// This allows for a global, userspace functions, and continued 4// This allows for a global, userspace functions, and continued
6// customization of the keymap. Use _keymap instead of _user 5// customization of the keymap. Use _keymap instead of _user
7// functions in the keymaps 6// functions in the keymaps
8__attribute__ ((weak)) 7__attribute__((weak)) void matrix_init_keymap(void) {}
9void matrix_init_keymap(void) {}
10 8
11// Call user matrix init, then call the keymap's init function 9// Call user matrix init, then call the keymap's init function
12void matrix_init_user(void) { 10void matrix_init_user(void) { matrix_init_keymap(); }
13 matrix_init_keymap();
14}
15 11
16 12__attribute__((weak)) void matrix_scan_keymap(void) {}
17__attribute__ ((weak))
18void matrix_scan_keymap(void) {}
19 13
20// No global matrix scan code, so just run keymap's matix 14// No global matrix scan code, so just run keymap's matix
21// scan function 15// scan function
22void matrix_scan_user(void) { 16void matrix_scan_user(void) { matrix_scan_keymap(); }
23 matrix_scan_keymap();
24}
25 17
26 18__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
27__attribute__ ((weak))
28bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
29 return true;
30}
31 19
32// Defines actions tor my global custom keycodes. Defined in drashna.h file 20// Defines actions tor my global custom keycodes. Defined in drashna.h file
33// Then runs the _keymap's recod handier if not processed here, 21// Then runs the _keymap's recod handier if not processed here,
34// And use "NEWPLACEHOLDER" for new safe range 22// And use "NEWPLACEHOLDER" for new safe range
35bool process_record_user(uint16_t keycode, keyrecord_t *record) { 23bool process_record_user(uint16_t keycode, keyrecord_t *record) {
36 24 switch (keycode) {
37 switch (keycode) { 25 case KC_MAKE:
38 case KC_MAKE: 26 if (!record->event.pressed) {
39 if (!record->event.pressed) { 27 SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
40 SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP 28#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
41#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) 29 ":dfu"
42 ":dfu"
43#elif defined(BOOTLOADER_HALFKAY) 30#elif defined(BOOTLOADER_HALFKAY)
44 ":teensy" 31 ":teensy"
45#elif defined(BOOTLOADER_CATERINA) 32#elif defined(BOOTLOADER_CATERINA)
46 ":avrdude" 33 ":avrdude"
47#endif 34#endif
48 SS_TAP(X_ENTER)); 35 SS_TAP(X_ENTER));
36 }
37 return false;
38 break;
39
40 case VRSN:
41 if (record->event.pressed) {
42 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
43 }
44 return false;
45 break;
49 } 46 }
50 return false; 47 return process_record_keymap(keycode, record);
51 break;
52
53 case VRSN:
54 if (record->event.pressed) {
55 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
56 }
57 return false;
58 break;
59 }
60 return process_record_keymap(keycode, record);
61}
62
63
64__attribute__ ((weak))
65layer_state_t layer_state_set_keymap (layer_state_t state) {
66 return state;
67}
68
69layer_state_t layer_state_set_user (layer_state_t state) {
70 return layer_state_set_keymap (state);
71} 48}
72 49
50__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
73 51
52layer_state_t layer_state_set_user(layer_state_t state) { return layer_state_set_keymap(state); }
74 53
75__attribute__ ((weak)) 54__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
76void led_set_keymap(uint8_t usb_led) {}
77
78void led_set_user(uint8_t usb_led) {
79 led_set_keymap(usb_led);
80}
81
82 55
56void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); }
83 57
84__attribute__ ((weak)) 58__attribute__((weak)) void suspend_power_down_keymap(void) {}
85void suspend_power_down_keymap(void) {}
86
87void suspend_power_down_user(void)
88{
89 suspend_power_down_keymap();
90}
91
92 59
60void suspend_power_down_user(void) { suspend_power_down_keymap(); }
93 61
94__attribute__ ((weak)) 62__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
95void suspend_wakeup_init_keymap(void) {}
96 63
97void suspend_wakeup_init_user(void) 64void suspend_wakeup_init_user(void) {
98{ 65 suspend_wakeup_init_keymap();
99 suspend_wakeup_init_keymap(); 66#ifdef KEYBOARD_ergodox_ez
100 #ifdef KEYBOARD_ergodox_ez 67 wait_ms(10);
101 wait_ms(10); 68#endif
102 #endif
103} 69}
104 70
71__attribute__((weak)) void startup_keymap(void) {}
105 72
106 73void startup_user(void) {
107__attribute__ ((weak)) 74#ifdef RGBLIGHT_ENABLE
108void startup_keymap(void) {}
109
110void startup_user (void) {
111 #ifdef RGBLIGHT_ENABLE
112 matrix_init_rgb(); 75 matrix_init_rgb();
113 #endif //RGBLIGHT_ENABLE 76#endif // RGBLIGHT_ENABLE
114 startup_keymap(); 77 startup_keymap();
115} 78}
116 79
80__attribute__((weak)) void shutdown_keymap(void) {}
117 81
118 82void shutdown_user(void) { shutdown_keymap(); }
119__attribute__ ((weak))
120void shutdown_keymap(void) {}
121
122void shutdown_user (void) {
123 shutdown_keymap();
124}