diff --git a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h index 7dae245a96..d8fbe9cb18 100644 --- a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h @@ -11,11 +11,12 @@ static void jellybean_raindrops_set_color(uint8_t i, effect_params_t* params) { } bool JELLYBEAN_RAINDROPS(effect_params_t* params) { - static uint16_t index = RGB_MATRIX_LED_COUNT + 1; + static uint16_t index[2] = { RGB_MATRIX_LED_COUNT + 1, RGB_MATRIX_LED_COUNT + 1 }; // TODO: more region? + uint8_t region = params->region; // Periodic trigger for LED change if ((params->iter == 0) && (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0)) { - index = random8_max(RGB_MATRIX_LED_COUNT); + index[region] = random8_max(RGB_MATRIX_LED_COUNT); } RGB_MATRIX_USE_LIMITS(led_min, led_max); @@ -25,9 +26,9 @@ bool JELLYBEAN_RAINDROPS(effect_params_t* params) { } } // Change LED once and set index out of range till next trigger - else if (led_min <= index && index < led_max) { - jellybean_raindrops_set_color(index, params); - index = RGB_MATRIX_LED_COUNT + 1; + else if (led_min <= index[region] && index[region] < led_max) { + jellybean_raindrops_set_color(index[region], params); + index[region] = RGB_MATRIX_LED_COUNT + 1; } return rgb_matrix_check_finished_leds(led_max); }