diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/state_params.i | 9 | ||||
-rw-r--r-- | include/ws2812b_writer.h | 13 |
2 files changed, 12 insertions, 10 deletions
diff --git a/include/state_params.i b/include/state_params.i new file mode 100644 index 0000000..447b72b --- /dev/null +++ b/include/state_params.i @@ -0,0 +1,9 @@ +STATE_PARAM(uint32_t, time) +STATE_PARAM(int, timetick) +STATE_PARAM(uint8_t, brightness) +STATE_PARAM(uint8_t, off) +STATE_PARAM(uint8_t, n_snow) +STATE_PARAM(uint8_t, n_red) +STATE_PARAM(bool, sleep) +STATE_PARAM(bool, power) +STATE_PARAM(bool, cool) diff --git a/include/ws2812b_writer.h b/include/ws2812b_writer.h index 9da9345..89b4f7a 100644 --- a/include/ws2812b_writer.h +++ b/include/ws2812b_writer.h @@ -10,16 +10,9 @@ typedef struct { ws2812b_t* drv; struct { - uint32_t time; - int timetick; - uint8_t brightness; - uint8_t off; - uint8_t n_snow; - uint8_t n_red; - - bool sleep; - bool power; - bool cool; +#define STATE_PARAM(t, n) t n; +#include "state_params.i" +#undef STATE_PARAM } state; } ws_params_t; |