From 47885d62b689bececb58b7bf9479a5c1ff1c9b5c Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 3 Dec 2024 22:31:31 -0700 Subject: Small fixes for the difference between RGB and GRB data formats. --- src/main.c | 5 +---- src/ws2812b.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src') 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; -- cgit