From afcacfb02c59b2ce2c9a9eeb6ec38aa08588f6dd Mon Sep 17 00:00:00 2001 From: SiteRelEnby Date: Fri, 2 Feb 2024 18:06:03 -0600 Subject: Bugfix: Tactical mode has a dependency on momentary mode Use case 1: Updating a t85 light, where tactical mode is useful but takes some squeezing, and momentary is less useful Use case 2: Custom builds for people who don't like/want momentary mode --- ui/anduril/anduril.c | 4 ++-- ui/anduril/strobe-modes.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c index 1cdb8d0..7557bf7 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 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 -- cgit v1.2.3 From 3cabd5acdddb7ace17b12fe1df9b6281f63b7905 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 28 Mar 2024 08:19:17 -0600 Subject: fixed Tactical Mode's strobes when Momentary Mode not enabled --- ui/anduril/anduril.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c index 7557bf7..4378816 100644 --- a/ui/anduril/anduril.c +++ b/ui/anduril/anduril.c @@ -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 -- cgit v1.2.3