diff options
Diffstat (limited to 'quantum/rgb_matrix/animations')
-rw-r--r-- | quantum/rgb_matrix/animations/solid_reactive_anim.h | 1 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/solid_reactive_simple_anim.h | 1 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/starlight_smooth_anim.h | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/quantum/rgb_matrix/animations/solid_reactive_anim.h b/quantum/rgb_matrix/animations/solid_reactive_anim.h index 67f568ca38..d11dda50c3 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_anim.h @@ -4,6 +4,7 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS static hsv_t SOLID_REACTIVE_math(hsv_t hsv, uint16_t offset) { + if (offset > 255) offset = 255; # ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); # endif diff --git a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h index f20f1b1fb6..22ba42296f 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h @@ -4,6 +4,7 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS static hsv_t SOLID_REACTIVE_SIMPLE_math(hsv_t hsv, uint16_t offset) { + if (offset > 255) offset = 255; # ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); # endif diff --git a/quantum/rgb_matrix/animations/starlight_smooth_anim.h b/quantum/rgb_matrix/animations/starlight_smooth_anim.h index a87c06f9df..5467ea0a59 100644 --- a/quantum/rgb_matrix/animations/starlight_smooth_anim.h +++ b/quantum/rgb_matrix/animations/starlight_smooth_anim.h @@ -9,7 +9,7 @@ static uint8_t phase_offsets[RGB_MATRIX_LED_COUNT]; hsv_t STARLIGHT_SMOOTH_math(hsv_t hsv, uint8_t i, uint8_t time) { if (phase_offsets[i] == 0) { - phase_offsets[i] = rand() % 255; + phase_offsets[i] = random8(); } hsv.v = scale8(abs8(sin8((time + phase_offsets[i]) / 2) - 128) * 2, hsv.v); return hsv; |