diff options
author | Joshua Diamond <josh@windowoffire.com> | 2022-07-30 18:31:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-30 18:31:31 -0400 |
commit | baf34989f1847185a055e9d41783052eccb09d9c (patch) | |
tree | f9f0a5f4cc4442a2ed33223a16e8d4cc8c4f9882 /users/spidey3/layer_rgb.c | |
parent | f02e3553808bb086b39946b63d5d4057060e02e7 (diff) |
Default rgblight (#17855)
* better rgb bindings; improve default
* trim firmware size
Diffstat (limited to 'users/spidey3/layer_rgb.c')
-rw-r--r-- | users/spidey3/layer_rgb.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/users/spidey3/layer_rgb.c b/users/spidey3/layer_rgb.c index 7381f64bb2..77558016d0 100644 --- a/users/spidey3/layer_rgb.c +++ b/users/spidey3/layer_rgb.c @@ -13,21 +13,15 @@ bool rgb_saved = 0; extern bool spi_gflock; extern uint16_t spi_replace_mode; -void spidey_glow(void) { +static void set_rgb_default(void) { rgblight_enable(); - rgblight_sethsv(213, 255, 128); - if ((RGBLIGHT_MODE_TWINKLE <= rgblight_get_mode()) && (rgblight_get_mode() < RGBLIGHT_MODE_TWINKLE_end)) { - rgblight_step(); - } else { - rgblight_mode(RGBLIGHT_MODE_TWINKLE); - } + rgblight_sethsv(RGBLIGHT_DEFAULT_HUE, RGBLIGHT_DEFAULT_SAT, RGBLIGHT_DEFAULT_VAL); + rgblight_mode(RGBLIGHT_DEFAULT_MODE); #ifdef VELOCIKEY_ENABLE if (velocikey_enabled()) velocikey_toggle(); #endif } -void eeconfig_init_user_rgb(void) { spidey_glow(); } - // clang-format off // Convenience macros @@ -396,11 +390,9 @@ extern rgblight_config_t rgblight_config; bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case SPI_GLO: - spidey_glow(); - return false; - // clang-format off + case SPI_GLO: set_rgb_default(); return false; + case RGB_HUI: change_timer = timer_read(); change_hue = 1; return false; case RGB_HUD: change_timer = timer_read(); change_hue = -1; return false; case RGB_SAI: change_timer = timer_read(); change_sat = 1; return false; |