aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorkb-elmo <lorwel@mailbox.org>2021-01-15 22:42:30 +0100
committerGitHub <noreply@github.com>2021-01-16 08:42:30 +1100
commit3d70766327422bcd918b6940298f7557ab10d248 (patch)
tree4f1c68b3b48030116f939c835dd045f30d2ea41a /quantum
parent0bf0977c02816c12fffc3fd75c11f66d044e0c20 (diff)
downloadqmk_firmware-3d70766327422bcd918b6940298f7557ab10d248.tar.gz
qmk_firmware-3d70766327422bcd918b6940298f7557ab10d248.zip
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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/quantum/color.h b/quantum/color.h
index 7448168b3..4783f6839 100644
--- a/quantum/color.h
+++ b/quantum/color.h
@@ -37,6 +37,7 @@
37 37
38#define WS2812_BYTE_ORDER_RGB 0 38#define WS2812_BYTE_ORDER_RGB 0
39#define WS2812_BYTE_ORDER_GRB 1 39#define WS2812_BYTE_ORDER_GRB 1
40#define WS2812_BYTE_ORDER_BGR 2
40 41
41#ifndef WS2812_BYTE_ORDER 42#ifndef WS2812_BYTE_ORDER
42# define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB 43# define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB
@@ -51,6 +52,10 @@ typedef struct PACKED {
51 uint8_t r; 52 uint8_t r;
52 uint8_t g; 53 uint8_t g;
53 uint8_t b; 54 uint8_t b;
55#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR)
56 uint8_t b;
57 uint8_t g;
58 uint8_t r;
54#endif 59#endif
55} cRGB; 60} cRGB;
56 61
@@ -66,6 +71,10 @@ typedef struct PACKED {
66 uint8_t r; 71 uint8_t r;
67 uint8_t g; 72 uint8_t g;
68 uint8_t b; 73 uint8_t b;
74#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR)
75 uint8_t b;
76 uint8_t g;
77 uint8_t r;
69#endif 78#endif
70 uint8_t w; 79 uint8_t w;
71} cRGBW; 80} cRGBW;