aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/anduril/lockout-mode.c4
-rw-r--r--ui/anduril/off-mode.c4
-rw-r--r--ui/anduril/ramp-mode.c8
3 files changed, 11 insertions, 5 deletions
diff --git a/ui/anduril/lockout-mode.c b/ui/anduril/lockout-mode.c
index 0e7b673..6f85ca9 100644
--- a/ui/anduril/lockout-mode.c
+++ b/ui/anduril/lockout-mode.c
@@ -65,13 +65,13 @@ uint8_t lockout_state(Event event, uint16_t arg) {
#if defined(TICK_DURING_STANDBY) && (defined(USE_INDICATOR_LED) || defined(USE_AUX_RGB_LEDS))
else if (event == EV_sleep_tick) {
if (ticks_since_on < 255) ticks_since_on ++;
- #ifdef USE_MANUAL_MEMORY_TIMER
+ #if defined(USE_MANUAL_MEMORY) && defined(USE_MANUAL_MEMORY_TIMER)
// reset to manual memory level when timer expires
if (cfg.manual_memory &&
(arg >= (cfg.manual_memory_timer * SLEEP_TICKS_PER_MINUTE))) {
manual_memory_restore();
}
- #endif
+ #endif // ifdef USE_MANUAL_MEMORY_TIMER
#if defined(USE_INDICATOR_LED)
indicator_led_update(cfg.indicator_led_mode >> 2, arg);
#elif defined(USE_AUX_RGB_LEDS)
diff --git a/ui/anduril/off-mode.c b/ui/anduril/off-mode.c
index 97c546e..36d771c 100644
--- a/ui/anduril/off-mode.c
+++ b/ui/anduril/off-mode.c
@@ -68,13 +68,13 @@ uint8_t off_state(Event event, uint16_t arg) {
// blink the indicator LED, maybe
else if (event == EV_sleep_tick) {
if (ticks_since_on < 255) ticks_since_on ++;
- #ifdef USE_MANUAL_MEMORY_TIMER
+ #if defined(USE_MANUAL_MEMORY) && defined(USE_MANUAL_MEMORY_TIMER)
// reset to manual memory level when timer expires
if (cfg.manual_memory &&
(arg >= (cfg.manual_memory_timer * SLEEP_TICKS_PER_MINUTE))) {
manual_memory_restore();
}
- #endif
+ #endif // ifdef USE_MANUAL_MEMORY_TIMER
#ifdef USE_INDICATOR_LED
indicator_led_update(cfg.indicator_led_mode & 0x03, arg);
#elif defined(USE_AUX_RGB_LEDS)
diff --git a/ui/anduril/ramp-mode.c b/ui/anduril/ramp-mode.c
index aff7be7..5ce1b54 100644
--- a/ui/anduril/ramp-mode.c
+++ b/ui/anduril/ramp-mode.c
@@ -569,8 +569,11 @@ uint8_t simple_ui_config_state(Event event, uint16_t arg) {
#ifdef USE_RAMP_EXTRAS_CONFIG
void ramp_extras_config_save(uint8_t step, uint8_t value) {
+ if (0) {}
+
+ #ifdef USE_MANUAL_MEMORY
// item 1: disable manual memory, go back to automatic
- if (manual_memory_config_step == step) {
+ else if (manual_memory_config_step == step) {
cfg.manual_memory = 0;
}
@@ -583,6 +586,7 @@ void ramp_extras_config_save(uint8_t step, uint8_t value) {
cfg.manual_memory_timer = value;
}
#endif
+ #endif // ifdef USE_MANUAL_MEMORY
#ifdef USE_RAMP_AFTER_MOON_CONFIG
// item 3: ramp up after hold-from-off for moon?
@@ -707,6 +711,7 @@ void set_level_and_therm_target(uint8_t level) {
#define set_level_and_therm_target(level) set_level(level)
#endif
+#ifdef USE_MANUAL_MEMORY
void manual_memory_restore() {
memorized_level = cfg.manual_memory;
#if NUM_CHANNEL_MODES > 1
@@ -728,6 +733,7 @@ void manual_memory_save() {
cfg.manual_memory_channel_args[i] = cfg.channel_mode_args[i];
#endif
}
+#endif // ifdef USE_MANUAL_MEMORY
#ifdef USE_SUNSET_TIMER
void reset_sunset_timer() {
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.