diff options
Diffstat (limited to 'drivers/chibios/ws2812.c')
-rw-r--r-- | drivers/chibios/ws2812.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/chibios/ws2812.c b/drivers/chibios/ws2812.c index c2bec3fdc9..b5b02fdacd 100644 --- a/drivers/chibios/ws2812.c +++ b/drivers/chibios/ws2812.c @@ -89,9 +89,16 @@ void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { for (uint8_t i = 0; i < leds; i++) { // WS2812 protocol dictates grb order +#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) sendByte(ledarray[i].g); sendByte(ledarray[i].r); sendByte(ledarray[i].b); +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) + sendByte(ledarray[i].r); + sendByte(ledarray[i].g); + sendByte(ledarray[i].b); +#endif + #ifdef RGBW sendByte(ledarray[i].w); #endif |