aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2021-12-02 17:19:00 -0700
committerJosh Rahm <joshuarahm@gmail.com>2021-12-02 17:19:00 -0700
commit8d379bf60e50960f6c855cd6b9c83956a082f73d (patch)
treeabc799411d565f7e0330ceb6d2db5818ea987d6a /include
parent62715093e446d952bbc3fa82fdb65deacd576be2 (diff)
downloadesp32-ws2812b-8d379bf60e50960f6c855cd6b9c83956a082f73d.tar.gz
esp32-ws2812b-8d379bf60e50960f6c855cd6b9c83956a082f73d.tar.bz2
esp32-ws2812b-8d379bf60e50960f6c855cd6b9c83956a082f73d.zip
Break out the state parmaters into their own include file.
This helps by creating one location to add state parameters.
Diffstat (limited to 'include')
-rw-r--r--include/state_params.i9
-rw-r--r--include/ws2812b_writer.h13
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;