diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/drv/ws2812b.h | 10 |
1 files changed, 10 insertions, 0 deletions
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_ */ |