diff --git a/quantum/rgblight.c b/quantum/rgblight.c index b14c464b58..2de6b00df0 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -64,6 +64,7 @@ static uint8_t static_effect_table [] = { #define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_ ## msym, #define _RGBM_TMP_DYNAMIC(sym, msym) RGBLIGHT_MODE_ ## msym, static uint8_t mode_base_table [] = { + 0, // RGBLIGHT_MODE_zero #include "rgblight.h" }; @@ -538,7 +539,7 @@ void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool if (rgblight_config.enable) { rgblight_status.base_mode = mode_base_table[rgblight_config.mode]; #ifdef RGBLIGHT_USE_TIMER - animation_status.pos = 0; + animation_status.pos16 = 0; #endif if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { // same static color @@ -743,7 +744,7 @@ void rgblight_update_sync(rgblight_config_t *config, rgblight_status_t *status, } } if (status->change_flags & RGBLIGHT_STATUS_ANIMATION_TICK) { - animation_status.pos = 0; + animation_status.pos16 = 0; } #endif } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 41f082f8c6..4414bf169c 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -265,7 +265,8 @@ typedef struct _animation_status_t { uint16_t last_timer; uint8_t delta; /* mode - base_mode */ union { - uint16_t pos; + uint16_t pos16; + uint8_t pos; uint16_t current_hue; uint16_t current_offset; int8_t low_bound;