diff --git a/drivers/leds/ws2812.c b/drivers/leds/ws2812.c index 4d16e5c1c0..850a35c642 100644 --- a/drivers/leds/ws2812.c +++ b/drivers/leds/ws2812.c @@ -55,15 +55,7 @@ * Pre-processor Definitions ****************************************************************************/ -#ifdef WS2812_HAS_WHITE -# define WS2812_RW_PIXEL_SIZE 4 -#else -# define WS2812_RW_PIXEL_SIZE 3 -#endif - -#ifdef CONFIG_WS2812_NON_SPI_DRIVER - -#else /* CONFIG_WS2812_NON_SPI_DRIVER */ +#ifndef CONFIG_WS2812_NON_SPI_DRIVER /* In order to meet the signaling timing requirements, the waveforms required * to represent a 0/1 symbol are created by specific SPI bytes defined here. diff --git a/include/nuttx/leds/ws2812.h b/include/nuttx/leds/ws2812.h index db7d467c70..f5e5b17c81 100644 --- a/include/nuttx/leds/ws2812.h +++ b/include/nuttx/leds/ws2812.h @@ -52,6 +52,12 @@ * Pre-processor Definitions ****************************************************************************/ +/* Although the LED might be RGB-only, the LED data is packed in a 32-bit + * long variable and, then, this is the default size of a LED pixel. + */ + +#define WS2812_RW_PIXEL_SIZE 4 + #ifdef __cplusplus #define EXTERN extern "C" extern "C"