From 80d6050ab3fe42f8850bf166c33eb3c9150a252b Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 29 Nov 2021 18:03:00 -0700 Subject: Add limited ability to control LEDs remotely. --- include/drv/ws2812b.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/drv/ws2812b.h b/include/drv/ws2812b.h index b14b31a..39f2794 100644 --- a/include/drv/ws2812b.h +++ b/include/drv/ws2812b.h @@ -40,4 +40,14 @@ static inline void ws2812b_buffer_set_rgb( buf->rgb[idx].b = b; } +static inline void ws2812b_buffer_set_color( + ws2812b_buffer_t* buf, size_t idx, ws2812b_rgb_t* color) +{ + if (idx >= buf->n_rgb) { + return; + } + + buf->rgb[idx] = *color; +} + #endif /* INCLUDE_DRV_WS2812B_H_ */ -- cgit