aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/http_server.h11
-rw-r--r--include/state_params.i21
-rw-r--r--include/ws2812b_writer.h4
3 files changed, 26 insertions, 10 deletions
diff --git a/include/http_server.h b/include/http_server.h
new file mode 100644
index 0000000..578b561
--- /dev/null
+++ b/include/http_server.h
@@ -0,0 +1,11 @@
+#pragma once
+#ifndef HTTP_SERVER_H_
+#define HTTP_SERVER_H_
+
+#include <esp_log.h>
+#include <esp_http_server.h>
+#include "ws2812b_writer.h"
+
+httpd_handle_t start_webserver(ws_params_t* params);
+
+#endif /* HTTP_SERVER_H_ */
diff --git a/include/state_params.i b/include/state_params.i
index 447b72b..15a5b43 100644
--- a/include/state_params.i
+++ b/include/state_params.i
@@ -1,9 +1,12 @@
-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)
+// List of parameters.
+// type name display name, default value
+
+STATE_PARAM(uint32_t, time, "Current Time", 0)
+STATE_PARAM(int, timetick, "Speed", 100)
+STATE_PARAM(uint8_t, brightness, "Brightness", 50)
+STATE_PARAM(uint8_t, n_snow, "Snow Effect", 10)
+STATE_PARAM(uint8_t, n_red, "Desaturation", 32)
+STATE_PARAM(int, x_scale, "X Scale", 255)
+STATE_PARAM(bool, power, "Power", true)
+STATE_PARAM(bool, cool, "Cool", false)
+STATE_PARAM(bool, invert, "Invert", false)
diff --git a/include/ws2812b_writer.h b/include/ws2812b_writer.h
index 89b4f7a..e8fa84f 100644
--- a/include/ws2812b_writer.h
+++ b/include/ws2812b_writer.h
@@ -6,11 +6,13 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
+extern const int NUMBER_PARAMS;
+
typedef struct {
ws2812b_t* drv;
struct {
-#define STATE_PARAM(t, n) t n;
+#define STATE_PARAM(t, n, ...) t n;
#include "state_params.i"
#undef STATE_PARAM
} state;