summaryrefslogtreecommitdiffstats
path: root/users/drashna
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 /users/drashna
parentc8577a9a7320ee0f68378b63b39b649f92016857 (diff)
Update Drashna user space code to support keyboard_init functions (#5138)
* Update code to support keyboard_init functions * Get Minor tweaks
Diffstat (limited to 'users/drashna')
-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
4 files changed, 33 insertions, 23 deletions
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 20e58fd0bb..2e125d1e4e 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -55,7 +55,7 @@
// and when this option isn't enabled, z rapidly followed by x
// actually sends Ctrl-x. That's bad.)
#define IGNORE_MOD_TAP_INTERRUPT
-// #define PERMISSIVE_HOLD
+#undef PERMISSIVE_HOLD
//#define TAPPING_FORCE_HOLD
//#define RETRO_TAPPING
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 2228248379..8019f26676 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -122,11 +122,17 @@ void matrix_init_user(void) {
get_unicode_input_mode();
#endif //UNICODE_ENABLE
matrix_init_keymap();
- #ifdef RGBLIGHT_ENABLE
- matrix_init_rgb();
- #endif //RGBLIGHT_ENABLE
}
+__attribute__((weak))
+void keyboard_post_init_keymap(void){ }
+
+void keyboard_post_init_user(void){
+#ifdef RGBLIGHT_ENABLE
+ keyboard_post_init_rgb();
+#endif
+ keyboard_post_init_keymap();
+}
__attribute__ ((weak))
void shutdown_keymap(void) {}
@@ -208,9 +214,11 @@ uint32_t default_layer_state_set_keymap (uint32_t state) {
// Runs state check and changes underglow color and animation
uint32_t default_layer_state_set_user(uint32_t state) {
state = default_layer_state_set_keymap(state);
+#if 0
#ifdef RGBLIGHT_ENABLE
state = default_layer_state_set_rgb(state);
#endif // RGBLIGHT_ENABLE
+#endif
return state;
}
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 37076ce990..7eaa7e9491 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) {
- void matrix_init_rgb(void) {
+void keyboard_post_init_rgb(void) {
-// #ifdef RGBLIGHT_ENABLE
-// if (userspace_config.rgb_layer_change) {
-// rgblight_enable_noeeprom();
-// switch (biton32(eeconfig_read_default_layer())) {
-// case _COLEMAK:
-// rgblight_sethsv_noeeprom_magenta(); break;
-// case _DVORAK:
-// rgblight_sethsv_noeeprom_springgreen(); break;
-// case _WORKMAN:
-// rgblight_sethsv_noeeprom_goldenrod(); break;
-// default:
-// rgblight_sethsv_noeeprom_cyan(); break;
-// }
-// rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT);
-// }
-// #endif
- }
+#ifdef RGBLIGHT_ENABLE
+ if (userspace_config.rgb_layer_change) {
+ rgblight_enable_noeeprom();
+ switch (biton32(eeconfig_read_default_layer())) {
+ case _COLEMAK:
+ rgblight_sethsv_noeeprom_magenta(); break;
+ case _DVORAK:
+ rgblight_sethsv_noeeprom_springgreen(); break;
+ case _WORKMAN:
+ rgblight_sethsv_noeeprom_goldenrod(); break;
+ default:
+ rgblight_sethsv_noeeprom_cyan(); break;
+ }
+ rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
+ }
+#endif
+}
void matrix_scan_rgb(void) {
#ifdef RGBLIGHT_TWINKLE
@@ -336,6 +336,7 @@ uint32_t layer_state_set_rgb(uint32_t state) {
return state;
}
+#if 0
uint32_t default_layer_state_set_rgb(uint32_t state) {
#ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) {
@@ -371,3 +372,4 @@ uint32_t default_layer_state_set_rgb(uint32_t state) {
#endif // RGBLIGHT_ENABLE
return state;
}
+#endif
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h
index 065bda9f9e..886f20ffcc 100644
--- a/users/drashna/rgb_stuff.h
+++ b/users/drashna/rgb_stuff.h
@@ -13,7 +13,7 @@ typedef struct {
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
void scan_rgblight_fadeout(void);
-void matrix_init_rgb(void);
+void keyboard_post_init_rgb(void);
void matrix_scan_rgb(void);
uint32_t layer_state_set_rgb(uint32_t state);
uint32_t default_layer_state_set_rgb(uint32_t state);