aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-05 16:10:01 -0700
committerSelene ToyKeeper2023-11-05 16:10:01 -0700
commitb43fc20617949458db4c1b562819a3b8f2757541 (patch)
tree3d676fe99c37654982eefcc18c196d25003a6ad7 /ui
parentMerge branch 'gretel-actions' into trunk (diff)
parentfixed build errors when #undef USE_MANUAL_MEMORY (diff)
downloadanduril-b43fc20617949458db4c1b562819a3b8f2757541.tar.gz
anduril-b43fc20617949458db4c1b562819a3b8f2757541.tar.bz2
anduril-b43fc20617949458db4c1b562819a3b8f2757541.zip
Merge branch 'DurvalMenezes-undef_USE_MANUAL_MEMORY_fix' into trunk
* DurvalMenezes-undef_USE_MANUAL_MEMORY_fix: fixed build errors when #undef USE_MANUAL_MEMORY (previous commit still failed) Fixes syntax errors when USE_MANUAL_MEMORY is undefined.
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() {