diff options
Diffstat (limited to 'quantum/rgb_matrix_animations/raindrops_anim.h')
-rw-r--r-- | quantum/rgb_matrix_animations/raindrops_anim.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index fc721375b..0e3a87864 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h | |||
@@ -5,7 +5,8 @@ | |||
5 | extern rgb_counters_t g_rgb_counters; | 5 | extern rgb_counters_t g_rgb_counters; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | static void raindrops_set_color(int i) { | 8 | static void raindrops_set_color(int i, effect_params_t* params) { |
9 | if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; | ||
9 | HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; | 10 | HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; |
10 | 11 | ||
11 | // Take the shortest path between hues | 12 | // Take the shortest path between hues |
@@ -25,14 +26,14 @@ bool rgb_matrix_raindrops(effect_params_t* params) { | |||
25 | if (!params->init) { | 26 | if (!params->init) { |
26 | // Change one LED every tick, make sure speed is not 0 | 27 | // Change one LED every tick, make sure speed is not 0 |
27 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { | 28 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { |
28 | raindrops_set_color(rand() % DRIVER_LED_TOTAL); | 29 | raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); |
29 | } | 30 | } |
30 | return false; | 31 | return false; |
31 | } | 32 | } |
32 | 33 | ||
33 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 34 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
34 | for (int i = led_min; i < led_max; i++) { | 35 | for (int i = led_min; i < led_max; i++) { |
35 | raindrops_set_color(i); | 36 | raindrops_set_color(i, params); |
36 | } | 37 | } |
37 | return led_max < DRIVER_LED_TOTAL; | 38 | return led_max < DRIVER_LED_TOTAL; |
38 | } | 39 | } |