Merge pull request #36 from zsa/fix/ws2812_matrix_refs

Fixing incorrect usage of RGBLED_NUM in ws2812 driver when used with RGB Matrix (#5744)
pull/5990/head
Florian Didron 6 years ago committed by GitHub
commit 2a70dc8eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;

@ -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 )

Loading…
Cancel
Save