aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/param.h4
-rw-r--r--include/state_params.i20
2 files changed, 14 insertions, 10 deletions
diff --git a/include/param.h b/include/param.h
index 5259e0a..d0b5bf0 100644
--- a/include/param.h
+++ b/include/param.h
@@ -6,6 +6,8 @@
typedef struct httpd_req httpd_req_t;
typedef uint32_t color_int_t;
+typedef uint8_t fraction_t;
+typedef uint16_t ratio_t;
#define DECL_PARAMETER_INSTANCE(ty) \
void handle_option__##ty(const char* attr, sockbuf_t* sockbuf, ty* ptr); \
@@ -24,5 +26,7 @@ DECL_PARAMETER_INSTANCE(uint8_t);
DECL_PARAMETER_INSTANCE(bool);
DECL_PARAMETER_INSTANCE(uint32_t);
DECL_PARAMETER_INSTANCE(color_int_t);
+DECL_PARAMETER_INSTANCE(fraction_t);
+DECL_PARAMETER_INSTANCE(ratio_t);
DECL_PARAMETER_INSTANCE(int);
DECL_PARAMETER_INSTANCE(int32_t);
diff --git a/include/state_params.i b/include/state_params.i
index e768768..854008d 100644
--- a/include/state_params.i
+++ b/include/state_params.i
@@ -4,16 +4,16 @@
// type name display name, default value
STATE_PARAM(int32_t, time, "Current Time", 0)
-STATE_PARAM(int, speed, "Speed", 1000)
-STATE_PARAM(uint8_t, brightness, "Brightness", 50)
+STATE_PARAM(ratio_t, speed, "Speed", 255)
+STATE_PARAM(fraction_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)
+STATE_PARAM(fraction_t, n_red, "Desaturation", 32)
+STATE_PARAM(ratio_t, x_scale, "X Scale", 255)
+STATE_PARAM(bool, power, "Power", true)
+STATE_PARAM(bool, cool, "Cool", false)
+STATE_PARAM(bool, invert, "Invert", false)
STATE_PARAM(bool, use_static_color, "Use Static Color", false)
STATE_PARAM(color_int_t, static_color, "Static Color", 0xffddbb)
-STATE_PARAM(bool, twinkle, "Twinkle", true)
-STATE_PARAM(uint8_t, twink_amt, "Twinkle Amount", 0)
-STATE_PARAM(uint8_t, base_brightness, "Base Brightness", 0)
+STATE_PARAM(bool, twinkle, "Twinkle", true)
+STATE_PARAM(fraction_t, twink_amt, "Twinkle Amount", 0)
+STATE_PARAM(fraction_t, base_brightness, "Base Brightness", 0)