From c89565cc3dda82642a0c6c839176602f05fc56f1 Mon Sep 17 00:00:00 2001 From: yiancar Date: Thu, 10 May 2018 05:31:24 +0100 Subject: General RGB matrix fixes (#2931) * Added Modular keyboards L,R and NUM Created code modules for the 3 modules of the modular keyboard. Original idea by MechboardsUK. Uses i2c implementation similar to lets split * Remove modular from master This is to fix incorrect branching * General fixes for RGB_matrix - Complited speed support for all effects - Fixed raindrop effects to initialized after toggle - Fixed raindrop effects to use all available LEDs - Fixed effect step reverse function - Moved RGB_MATRIX_SOLID_REACTIVE under correct flag * Documentation update for RGBmatrix * More doc updates --- quantum/rgb_matrix.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'quantum/rgb_matrix.c') diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 558e28dec..f3d012bc3 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -324,8 +324,8 @@ void rgb_matrix_raindrops(bool initialize) { HSV hsv; RGB rgb; - // Change one LED every tick - uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % DRIVER_LED_TOTAL : 255; + // Change one LED every tick, make sure speed is not 0 + uint8_t led_to_change = ( g_tick & ( 0x0A / (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed) ) ) == 0 ? rand() % (DRIVER_LED_TOTAL) : 255; for ( int i=0; i