diff options
| author | Selene ToyKeeper | 2024-03-28 08:28:54 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2024-03-28 08:28:54 -0600 |
| commit | f15310efe87b4e761d40f684d9044a3df84ff165 (patch) | |
| tree | 34e69987220cef3f1c2c656dfa7f93818ee9d9b2 | |
| parent | Merge branch 'pr49-SiteRelEnby-tactical-mode-3c-fix' into trunk (diff) | |
| parent | fixed Tactical Mode's strobes when Momentary Mode not enabled (diff) | |
| download | anduril-f15310efe87b4e761d40f684d9044a3df84ff165.tar.gz anduril-f15310efe87b4e761d40f684d9044a3df84ff165.tar.bz2 anduril-f15310efe87b4e761d40f684d9044a3df84ff165.zip | |
Merge branch 'pr46-SiteRelEnby-bugfix-tacmode-without-momentary' into trunk
Allows user to disable Momentary Mode at compile time,
while keeping Tactical Mode.
* pr46-SiteRelEnby-bugfix-tacmode-without-momentary:
fixed Tactical Mode's strobes when Momentary Mode not enabled
Bugfix: Tactical mode has a dependency on momentary mode
| -rw-r--r-- | ui/anduril/anduril.c | 12 | ||||
| -rw-r--r-- | ui/anduril/strobe-modes.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c index 1cdb8d0..4378816 100644 --- a/ui/anduril/anduril.c +++ b/ui/anduril/anduril.c @@ -121,7 +121,7 @@ #include "anduril/lockout-mode.h" #endif -#ifdef USE_MOMENTARY_MODE +#if (defined(USE_MOMENTARY_MODE) || defined(USE_TACTICAL_MODE)) #include "anduril/momentary-mode.h" #endif @@ -189,7 +189,7 @@ #include "anduril/lockout-mode.c" #endif -#ifdef USE_MOMENTARY_MODE +#if (defined(USE_MOMENTARY_MODE) || defined(USE_TACTICAL_MODE)) #include "anduril/momentary-mode.c" #endif @@ -293,10 +293,12 @@ void loop() { #ifdef USE_STROBE_STATE else if ((state == strobe_state) - #ifdef USE_MOMENTARY_MODE + #if defined(USE_MOMENTARY_MODE) || defined(USE_TACTICAL_MODE) // also handle momentary strobes - || (( - (state == momentary_state) + || ((0 + #ifdef USE_MOMENTARY_MODE + || (state == momentary_state) + #endif #ifdef USE_TACTICAL_MODE || (state == tactical_state) #endif diff --git a/ui/anduril/strobe-modes.c b/ui/anduril/strobe-modes.c index ccc4aa0..38e4dca 100644 --- a/ui/anduril/strobe-modes.c +++ b/ui/anduril/strobe-modes.c @@ -13,7 +13,7 @@ uint8_t strobe_state(Event event, uint16_t arg) { // 'st' reduces ROM size slightly strobe_mode_te st = current_strobe_type; - #ifdef USE_MOMENTARY_MODE + #if defined(USE_MOMENTARY_MODE) || defined(USE_TACTICAL_MODE) momentary_mode = 1; // 0 = ramping, 1 = strobes #endif |
