aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-02-16 18:28:04 -0800
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-16 18:28:04 -0800
commitcbb7e91851fea0174a5e950c22c35a4384eac8e7 (patch)
treeb4bfd4d637c3d004ab49a4ec174e9f291d19f7ef
parentc8577a9a7320ee0f68378b63b39b649f92016857 (diff)
downloadqmk_firmware-cbb7e91851fea0174a5e950c22c35a4384eac8e7.tar.gz
qmk_firmware-cbb7e91851fea0174a5e950c22c35a4384eac8e7.zip
Update Drashna user space code to support keyboard_init functions (#5138)
* Update code to support keyboard_init functions * Get Minor tweaks
-rw-r--r--layouts/community/ergodox/drashna_glow/rules.mk1
-rw-r--r--users/drashna/config.h2
-rw-r--r--users/drashna/drashna.c14
-rw-r--r--users/drashna/rgb_stuff.c38
-rw-r--r--users/drashna/rgb_stuff.h2
5 files changed, 34 insertions, 23 deletions
diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk
index e152fa01f..5cb47dae4 100644
--- a/layouts/community/ergodox/drashna_glow/rules.mk
+++ b/layouts/community/ergodox/drashna_glow/rules.mk
@@ -6,4 +6,5 @@ SRC += ../drashna/keymap.c
6ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) 6ifneq (,$(findstring ergodox_ez,$(KEYBOARD)))
7 RGBLIGHT_ENABLE = no 7 RGBLIGHT_ENABLE = no
8 RGB_MATRIX_ENABLE = yes 8 RGB_MATRIX_ENABLE = yes
9 TAP_DANCE_ENABLE = no
9endif 10endif
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 20e58fd0b..2e125d1e4 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -55,7 +55,7 @@
55// and when this option isn't enabled, z rapidly followed by x 55// and when this option isn't enabled, z rapidly followed by x
56// actually sends Ctrl-x. That's bad.) 56// actually sends Ctrl-x. That's bad.)
57#define IGNORE_MOD_TAP_INTERRUPT 57#define IGNORE_MOD_TAP_INTERRUPT
58// #define PERMISSIVE_HOLD 58#undef PERMISSIVE_HOLD
59//#define TAPPING_FORCE_HOLD 59//#define TAPPING_FORCE_HOLD
60//#define RETRO_TAPPING 60//#define RETRO_TAPPING
61 61
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 222824837..8019f2667 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -122,11 +122,17 @@ void matrix_init_user(void) {
122 get_unicode_input_mode(); 122 get_unicode_input_mode();
123 #endif //UNICODE_ENABLE 123 #endif //UNICODE_ENABLE
124 matrix_init_keymap(); 124 matrix_init_keymap();
125 #ifdef RGBLIGHT_ENABLE
126 matrix_init_rgb();
127 #endif //RGBLIGHT_ENABLE
128} 125}
129 126
127__attribute__((weak))
128void keyboard_post_init_keymap(void){ }
129
130void keyboard_post_init_user(void){
131#ifdef RGBLIGHT_ENABLE
132 keyboard_post_init_rgb();
133#endif
134 keyboard_post_init_keymap();
135}
130 136
131__attribute__ ((weak)) 137__attribute__ ((weak))
132void shutdown_keymap(void) {} 138void shutdown_keymap(void) {}
@@ -208,9 +214,11 @@ uint32_t default_layer_state_set_keymap (uint32_t state) {
208// Runs state check and changes underglow color and animation 214// Runs state check and changes underglow color and animation
209uint32_t default_layer_state_set_user(uint32_t state) { 215uint32_t default_layer_state_set_user(uint32_t state) {
210 state = default_layer_state_set_keymap(state); 216 state = default_layer_state_set_keymap(state);
217#if 0
211#ifdef RGBLIGHT_ENABLE 218#ifdef RGBLIGHT_ENABLE
212 state = default_layer_state_set_rgb(state); 219 state = default_layer_state_set_rgb(state);
213#endif // RGBLIGHT_ENABLE 220#endif // RGBLIGHT_ENABLE
221#endif
214 return state; 222 return state;
215} 223}
216 224
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 37076ce99..7eaa7e949 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -243,25 +243,25 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
243 243
244 244
245 245
246 void matrix_init_rgb(void) { 246void keyboard_post_init_rgb(void) {
247 247
248// #ifdef RGBLIGHT_ENABLE 248#ifdef RGBLIGHT_ENABLE
249// if (userspace_config.rgb_layer_change) { 249 if (userspace_config.rgb_layer_change) {
250// rgblight_enable_noeeprom(); 250 rgblight_enable_noeeprom();
251// switch (biton32(eeconfig_read_default_layer())) { 251 switch (biton32(eeconfig_read_default_layer())) {
252// case _COLEMAK: 252 case _COLEMAK:
253// rgblight_sethsv_noeeprom_magenta(); break; 253 rgblight_sethsv_noeeprom_magenta(); break;
254// case _DVORAK: 254 case _DVORAK:
255// rgblight_sethsv_noeeprom_springgreen(); break; 255 rgblight_sethsv_noeeprom_springgreen(); break;
256// case _WORKMAN: 256 case _WORKMAN:
257// rgblight_sethsv_noeeprom_goldenrod(); break; 257 rgblight_sethsv_noeeprom_goldenrod(); break;
258// default: 258 default:
259// rgblight_sethsv_noeeprom_cyan(); break; 259 rgblight_sethsv_noeeprom_cyan(); break;
260// } 260 }
261// rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); 261 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
262// } 262 }
263// #endif 263#endif
264 } 264}
265 265
266void matrix_scan_rgb(void) { 266void matrix_scan_rgb(void) {
267#ifdef RGBLIGHT_TWINKLE 267#ifdef RGBLIGHT_TWINKLE
@@ -336,6 +336,7 @@ uint32_t layer_state_set_rgb(uint32_t state) {
336 return state; 336 return state;
337} 337}
338 338
339#if 0
339uint32_t default_layer_state_set_rgb(uint32_t state) { 340uint32_t default_layer_state_set_rgb(uint32_t state) {
340#ifdef RGBLIGHT_ENABLE 341#ifdef RGBLIGHT_ENABLE
341 if (userspace_config.rgb_layer_change) { 342 if (userspace_config.rgb_layer_change) {
@@ -371,3 +372,4 @@ uint32_t default_layer_state_set_rgb(uint32_t state) {
371#endif // RGBLIGHT_ENABLE 372#endif // RGBLIGHT_ENABLE
372 return state; 373 return state;
373} 374}
375#endif
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h
index 065bda9f9..886f20ffc 100644
--- a/users/drashna/rgb_stuff.h
+++ b/users/drashna/rgb_stuff.h
@@ -13,7 +13,7 @@ typedef struct {
13 13
14bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); 14bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
15void scan_rgblight_fadeout(void); 15void scan_rgblight_fadeout(void);
16void matrix_init_rgb(void); 16void keyboard_post_init_rgb(void);
17void matrix_scan_rgb(void); 17void matrix_scan_rgb(void);
18uint32_t layer_state_set_rgb(uint32_t state); 18uint32_t layer_state_set_rgb(uint32_t state);
19uint32_t default_layer_state_set_rgb(uint32_t state); 19uint32_t default_layer_state_set_rgb(uint32_t state);