diff options
author | kb-elmo <lorwel@mailbox.org> | 2021-01-15 22:42:30 +0100 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2021-02-02 09:40:28 -0800 |
commit | 329d563bf93911178ad7066588b829335ff5ff3b (patch) | |
tree | b180bb2f20720492843d91abf9ea7ae69a1b63b3 /quantum | |
parent | 0719cda8514df3d2d361667aff577d28f67e1f09 (diff) |
Add BGR byte order for WS2812 drivers (#11562)
* add byte order bgr for ws2812
* update docs for driver change
* Update ws2812_driver.md
* Update docs/ws2812_driver.md
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/color.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/quantum/color.h b/quantum/color.h index 7448168b3a..4783f6839c 100644 --- a/quantum/color.h +++ b/quantum/color.h @@ -37,6 +37,7 @@ #define WS2812_BYTE_ORDER_RGB 0 #define WS2812_BYTE_ORDER_GRB 1 +#define WS2812_BYTE_ORDER_BGR 2 #ifndef WS2812_BYTE_ORDER # define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB @@ -51,6 +52,10 @@ typedef struct PACKED { uint8_t r; uint8_t g; uint8_t b; +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) + uint8_t b; + uint8_t g; + uint8_t r; #endif } cRGB; @@ -66,6 +71,10 @@ typedef struct PACKED { uint8_t r; uint8_t g; uint8_t b; +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) + uint8_t b; + uint8_t g; + uint8_t r; #endif uint8_t w; } cRGBW; |