aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-02-02 18:05:36 +0100
committerLouis Burda <quent.burda@gmail.com>2023-02-02 18:05:49 +0100
commitb50765e6377eda0b6b4aa292379f8b01e48ae5c0 (patch)
tree6dfe043452bcb791653beeab078a16245226714c /src
parent1f1b153d6f5a25c6929af1562cb9d67b9843007e (diff)
downloadsxkbd-b50765e6377eda0b6b4aa292379f8b01e48ae5c0.tar.gz
sxkbd-b50765e6377eda0b6b4aa292379f8b01e48ae5c0.zip
Fix swapped led color channels
Diffstat (limited to 'src')
-rw-r--r--src/ws2812.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ws2812.c b/src/ws2812.c
index 943cd52..b3e23f1 100644
--- a/src/ws2812.c
+++ b/src/ws2812.c
@@ -39,7 +39,7 @@ ws2812_init(struct ws2812 *pix, PIO pio, uint pin)
void
ws2812_put(struct ws2812 *pix, uint32_t rgb) {
- rgb = ((rgb & 0xFF0000) >> 16) | ((rgb & 0x00FF00) << 8)
- | ((rgb & 0x0000FF) << 8);
+ rgb = ((rgb & 0xFF0000) >> 8) | ((rgb & 0x00FF00) << 8)
+ | (rgb & 0x0000FF);
pio_sm_put_blocking(pix->pio, pix->sm, rgb << 8u);
}