Skip to content

Commit

Permalink
Merge branch 'pr46-SiteRelEnby-bugfix-tacmode-without-momentary' into…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
ToyKeeper committed Mar 28, 2024
2 parents 5669781 + 3cabd5a commit f15310e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions ui/anduril/anduril.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ui/anduril/strobe-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f15310e

Please sign in to comment.