diff options
Diffstat (limited to 'users/drashna/rgb_stuff.c')
| -rw-r--r-- | users/drashna/rgb_stuff.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index a98ad590c..b5e145842 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -247,17 +247,20 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 247 | 247 | ||
| 248 | 248 | ||
| 249 | void keyboard_post_init_rgb(void) { | 249 | void keyboard_post_init_rgb(void) { |
| 250 | #ifdef RGBLIGHT_ENABLE | 250 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) |
| 251 | rgblight_enable_noeeprom(); | 251 | if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } |
| 252 | layer_state_set_user(layer_state); | 252 | if (rgblight_config.enable) { |
| 253 | uint16_t old_hue = rgblight_config.hue; | 253 | layer_state_set_user(layer_state); |
| 254 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | 254 | uint16_t old_hue = rgblight_config.hue; |
| 255 | for (uint16_t i = 360; i > 0; i--) { | 255 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
| 256 | rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); | 256 | for (uint16_t i = 360; i > 0; i--) { |
| 257 | wait_ms(10); | 257 | rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); |
| 258 | } | 258 | matrix_scan(); |
| 259 | layer_state_set_user(layer_state); | 259 | wait_ms(10); |
| 260 | } | ||
| 261 | } | ||
| 260 | #endif | 262 | #endif |
| 263 | layer_state_set_user(layer_state); | ||
| 261 | } | 264 | } |
| 262 | 265 | ||
| 263 | void matrix_scan_rgb(void) { | 266 | void matrix_scan_rgb(void) { |
| @@ -278,7 +281,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { | |||
| 278 | switch (biton32(state)) { | 281 | switch (biton32(state)) { |
| 279 | case _MACROS: | 282 | case _MACROS: |
| 280 | rgblight_sethsv_noeeprom_orange(); | 283 | rgblight_sethsv_noeeprom_orange(); |
| 281 | userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3); | 284 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); |
| 282 | break; | 285 | break; |
| 283 | case _MEDIA: | 286 | case _MEDIA: |
| 284 | rgblight_sethsv_noeeprom_chartreuse(); | 287 | rgblight_sethsv_noeeprom_chartreuse(); |
