qmk

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

commit 50bc2dbe77e533959c4b8f821a31b489d25c7cb7
parent 61ce41ae13242adb113f61ec03dd9ed26acee26b
Author: XScorpion2 <rcalt2vt@gmail.com>
Date:   Wed,  1 May 2019 07:48:33 -0500

Fixing incorrect usage of RGBLED_NUM in ws2812 driver when used with RGB Matrix (#5744)


Diffstat:
drivers/avr/ws2812.c | 2+-
quantum/rgb_matrix_drivers.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/avr/ws2812.c b/drivers/avr/ws2812.c @@ -158,7 +158,7 @@ void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b) void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b) { - for (int i = 0; i < RGBLED_NUM; i++) { + for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) { led[i].r = r; led[i].g = g; led[i].b = b; diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c @@ -99,12 +99,12 @@ const rgb_matrix_driver_t rgb_matrix_driver = { #elif defined(WS2812) -extern LED_TYPE led[RGBLED_NUM]; +extern LED_TYPE led[DRIVER_LED_TOTAL]; static void flush( void ) { // Assumes use of RGB_DI_PIN - ws2812_setleds(led, RGBLED_NUM); + ws2812_setleds(led, DRIVER_LED_TOTAL); } static void init( void )