aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-05 16:52:19 -0700
committerSelene ToyKeeper2023-11-05 16:52:19 -0700
commit661c852af173b6bd61377ac2a343cbfed8ad64b7 (patch)
tree43328872595a7e4bcd470fc8a64a32d6bc91bff4
parentMerge branch 'DurvalMenezes-undef_USE_MANUAL_MEMORY_fix' into trunk (diff)
parentmore consistent syntax, to avoid failed builds when various options are used (diff)
downloadanduril-661c852af173b6bd61377ac2a343cbfed8ad64b7.tar.gz
anduril-661c852af173b6bd61377ac2a343cbfed8ad64b7.tar.bz2
anduril-661c852af173b6bd61377ac2a343cbfed8ad64b7.zip
Merge branch 'johnou-bugfix/no-simple-ui-error' into trunk
* johnou-bugfix/no-simple-ui-error: more consistent syntax, to avoid failed builds when various options are used Fix compile error when Simple UI is undefined.
-rw-r--r--ui/anduril/channel-modes.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/ui/anduril/channel-modes.c b/ui/anduril/channel-modes.c
index ccac58c..74e7ea4 100644
--- a/ui/anduril/channel-modes.c
+++ b/ui/anduril/channel-modes.c
@@ -20,11 +20,13 @@ uint8_t channel_mode_state(Event event, uint16_t arg) {
uint8_t tint = cfg.channel_mode_args[channel_mode];
#endif
+ if (0) {}
+
// it's possible that a light may need 3H but not 3C,
// so try to detect if 3C is needed
#if NUM_CHANNEL_MODES > 1
// 3 clicks: next channel mode
- if (event == EV_3clicks) {
+ else if (event == EV_3clicks) {
uint8_t next = channel_mode;
// go to next channel mode until we find one which is enabled
// (and don't do any infinite loops if the user disabled them all)
@@ -48,22 +50,22 @@ uint8_t channel_mode_state(Event event, uint16_t arg) {
cfg.channel_mode = channel_mode;
save_config();
return EVENT_HANDLED;
- } else
+ }
#endif // if NUM_CHANNEL_MODES > 1
#ifdef USE_CUSTOM_CHANNEL_3H_MODES
// defer to mode-specific function if defined
- if (channel_3H_modes[channel_mode]) {
+ else if (channel_3H_modes[channel_mode]) {
StatePtr tint_func = channel_3H_modes[channel_mode];
uint8_t err = tint_func(event, arg);
if (EVENT_HANDLED == err) return EVENT_HANDLED;
// else let the default handler run
}
#endif
- #ifdef USE_CHANNEL_MODE_ARGS
- #ifndef DONT_USE_DEFAULT_CHANNEL_ARG_MODE
+
+ #if defined(USE_CHANNEL_MODE_ARGS) && !defined(DONT_USE_DEFAULT_CHANNEL_ARG_MODE)
// click, click, hold: change the current channel's arg (like tint)
- if (event == EV_click3_hold) {
+ else if (event == EV_click3_hold) {
///// adjust value from 0 to 255
// reset at beginning of movement
if (! arg) {
@@ -118,12 +120,11 @@ uint8_t channel_mode_state(Event event, uint16_t arg) {
set_level(actual_level);
return EVENT_HANDLED;
}
- #endif // ifndef DONT_USE_DEFAULT_CHANNEL_ARG_MODE
- #endif // ifdef USE_CHANNEL_MODE_ARGS
+ #endif // if defined(USE_CHANNEL_MODE_ARGS) && !defined(DONT_USE_DEFAULT_CHANNEL_ARG_MODE)
#if defined(USE_SIMPLE_UI)
// remaining mappings aren't "simple", so stop here
- if (cfg.simple_ui_active) {
+ else if (cfg.simple_ui_active) {
return EVENT_NOT_HANDLED;
}
#endif