aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-12-11 11:11:18 +0100
committerKarel Kočí <cynerd@email.cz>2022-12-11 11:11:18 +0100
commit000c20d71a54bd6a0914e696fc88b4161c17c45d (patch)
tree1647c69a40b47474610beca2e06847fd6fa52caa
parent062236c37f1e84c3a8ae10cba5b223f2ef1775f9 (diff)
downloadbigclown-leds-000c20d71a54bd6a0914e696fc88b4161c17c45d.tar.gz
bigclown-leds-000c20d71a54bd6a0914e696fc88b4161c17c45d.tar.bz2
bigclown-leds-000c20d71a54bd6a0914e696fc88b4161c17c45d.zip
Tweak the firmware
-rwxr-xr-xbigclown-leds2
-rw-r--r--control/gui.c3
-rw-r--r--control/ledctl.c6
-rw-r--r--control/state.h1
4 files changed, 9 insertions, 3 deletions
diff --git a/bigclown-leds b/bigclown-leds
index 29d2e31..46b3c88 100755
--- a/bigclown-leds
+++ b/bigclown-leds
@@ -11,7 +11,7 @@ def on_connect(client, userdata, flags, rc):
def on_message(client, userdata, msg):
topic = msg.topic[26:]
if topic == 'effect/set':
- # Well for now just this way
+ # Well for now just this way
client.publish(
'node/power-controller:0/led-strip/-/effect/set',
'{"type": "rainbow", "wait":50}')
diff --git a/control/gui.c b/control/gui.c
index e70ff87..1ca6142 100644
--- a/control/gui.c
+++ b/control/gui.c
@@ -19,6 +19,9 @@ void update_gui() {
bc_module_lcd_draw_string(43, 2, "OFF", false);
switch (mode) {
+ case MODE_SOLID_WARM:
+ bc_module_lcd_draw_string(40, 26, "warm", true);
+ break;
case MODE_SOLID_RED:
bc_module_lcd_draw_string(46, 26, "red", true);
break;
diff --git a/control/ledctl.c b/control/ledctl.c
index 76bdc67..8a5bfea 100644
--- a/control/ledctl.c
+++ b/control/ledctl.c
@@ -5,6 +5,7 @@
const char *mode_string[] = {
+ [MODE_SOLID_WARM] = "#70200A",
[MODE_SOLID_RED] = "#FF0000",
[MODE_SOLID_GREEN] = "#00FF00",
[MODE_SOLID_BLUE] = "#0000FF",
@@ -34,6 +35,7 @@ void click_left() {
switch (state) {
case STATE_DEFAULT:
enabled = 1;
+ update_mode(); // just to make sure that all is in sync
update_brightness();
break;
case STATE_BRIGHTNESS_SELECT:
@@ -43,7 +45,7 @@ void click_left() {
break;
case STATE_COLOR_SELECT:
if (mode >= MODE_RAINBOW)
- mode = MODE_SOLID_RED;
+ mode = MODE_SOLID_WARM;
else
mode++;
update_mode();
@@ -65,7 +67,7 @@ void click_right() {
update_brightness();
break;
case STATE_COLOR_SELECT:
- if (mode <= MODE_SOLID_RED)
+ if (mode <= MODE_SOLID_WARM)
mode = MODE_RAINBOW;
else
mode--;
diff --git a/control/state.h b/control/state.h
index 5f9525f..fab1e12 100644
--- a/control/state.h
+++ b/control/state.h
@@ -2,6 +2,7 @@
#define _STATE_H_
enum led_mode {
+ MODE_SOLID_WARM,
MODE_SOLID_RED,
MODE_SOLID_GREEN,
MODE_SOLID_BLUE,