drivers/leds/ws2812: Fix WS2812 pixel size

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 to define the 'WS2812_RW_PIXEL_SIZE' macro. Please note that
the lower-half driver will deal with the case of the addressable
LED being 3 or 4-pixel sized.
This commit is contained in:
Tiago Medicci Serrano 2023-12-15 10:29:27 -03:00 committed by Xiang Xiao
parent fcff5d43b7
commit d1326e81bc
2 changed files with 7 additions and 9 deletions

View File

@ -55,15 +55,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifdef WS2812_HAS_WHITE #ifndef CONFIG_WS2812_NON_SPI_DRIVER
# 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 */
/* In order to meet the signaling timing requirements, the waveforms required /* 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. * to represent a 0/1 symbol are created by specific SPI bytes defined here.

View File

@ -52,6 +52,12 @@
* Pre-processor Definitions * 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 #ifdef __cplusplus
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" extern "C"