aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-12-03 22:31:31 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-12-03 22:31:31 -0700
commit47885d62b689bececb58b7bf9479a5c1ff1c9b5c (patch)
tree40ceb2acf3b9fdc0706b62c933b504229911c91a /src
parent326b366d3fe353493d2f14beeb94a4fd1a2ce11a (diff)
downloadch573-47885d62b689bececb58b7bf9479a5c1ff1c9b5c.tar.gz
ch573-47885d62b689bececb58b7bf9479a5c1ff1c9b5c.tar.bz2
ch573-47885d62b689bececb58b7bf9479a5c1ff1c9b5c.zip
Small fixes for the difference between RGB and GRB data formats.
Diffstat (limited to 'src')
-rw-r--r--src/main.c5
-rw-r--r--src/ws2812b.c2
2 files changed, 2 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index ac5da83..2bbd0b3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -210,9 +210,7 @@ int main(void)
size_t n = sizeof(buf);
struct ws2812b_buf ws_buf;
make_wsb2812b(&ws_buf, buf, n);
- ws_buf.byte_order = BYTE_ORDER_GBR;
-
- printf("Test %u", byte_scale(40, 0x80));
+ ws_buf.byte_order = BYTE_ORDER_RGB;
rgb_t color;
uint32_t time = 0;
@@ -228,7 +226,6 @@ int main(void)
time++;
GPIO_PORT.out.set(GPIO_PORT_B, ON, 7);
- // printf("WS_BUF: %p, %zu\n", ws_buf.buf, ws_buf.cur);
for (int i = 0; i < N_DMA_XFER; ++i) {
wait_for_dma();
start_dma(&ws_buf);
diff --git a/src/ws2812b.c b/src/ws2812b.c
index 3721b23..1dea9f1 100644
--- a/src/ws2812b.c
+++ b/src/ws2812b.c
@@ -32,7 +32,7 @@
inline static void complie_color_inline(
rgb_t color, struct rgb_compiled* out, enum ws2812b_byte_order byte_order)
{
- if (byte_order == BYTE_ORDER_GBR) {
+ if (byte_order == BYTE_ORDER_GRB) {
uint8_t tmp = color.r;
color.r = color.g;
color.g = tmp;