aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-08-24 14:17:13 -0600
committerSelene ToyKeeper2023-08-24 14:17:13 -0600
commit7c806f123c23a4afccfc30564ba38e965e34e987 (patch)
treee047abe6bfc8792941d82cc4f2252483197d627b
parentnewer TS10 ramp, more low modes (max 7135 at ramp 90/150 like SammysHP's ramp) (diff)
downloadanduril-7c806f123c23a4afccfc30564ba38e965e34e987.tar.gz
anduril-7c806f123c23a4afccfc30564ba38e965e34e987.tar.bz2
anduril-7c806f123c23a4afccfc30564ba38e965e34e987.zip
fixed issue where tactical mode overrode strobe group memory
-rw-r--r--spaghetti-monster/anduril/strobe-modes.c9
-rw-r--r--spaghetti-monster/anduril/strobe-modes.h2
-rw-r--r--spaghetti-monster/anduril/tactical-mode.c2
3 files changed, 8 insertions, 5 deletions
diff --git a/spaghetti-monster/anduril/strobe-modes.c b/spaghetti-monster/anduril/strobe-modes.c
index 0a4ff98..4d06d77 100644
--- a/spaghetti-monster/anduril/strobe-modes.c
+++ b/spaghetti-monster/anduril/strobe-modes.c
@@ -11,7 +11,7 @@ uint8_t strobe_state(Event event, uint16_t arg) {
static int8_t ramp_direction = 1;
// 'st' reduces ROM size slightly
- strobe_mode_te st = cfg.strobe_type;
+ strobe_mode_te st = current_strobe_type;
#ifdef USE_MOMENTARY_MODE
momentary_mode = 1; // 0 = ramping, 1 = strobes
@@ -28,6 +28,7 @@ uint8_t strobe_state(Event event, uint16_t arg) {
if (0) {} // placeholder
// init anything which needs to be initialized
else if (event == EV_enter_state) {
+ current_strobe_type = cfg.strobe_type;
ramp_direction = 1;
return EVENT_HANDLED;
}
@@ -38,13 +39,13 @@ uint8_t strobe_state(Event event, uint16_t arg) {
}
// 2 clicks: rotate through strobe/flasher modes
else if (event == EV_2clicks) {
- cfg.strobe_type = (st + 1) % NUM_STROBES;
+ current_strobe_type = cfg.strobe_type = (st + 1) % NUM_STROBES;
save_config();
return EVENT_HANDLED;
}
// 4 clicks: rotate backward through strobe/flasher modes
else if (event == EV_4clicks) {
- cfg.strobe_type = (st - 1 + NUM_STROBES) % NUM_STROBES;
+ current_strobe_type = cfg.strobe_type = (st - 1 + NUM_STROBES) % NUM_STROBES;
save_config();
return EVENT_HANDLED;
}
@@ -154,7 +155,7 @@ uint8_t strobe_state(Event event, uint16_t arg) {
// runs repeatedly in FSM loop() whenever UI is in strobe_state or momentary strobe
inline void strobe_state_iter() {
- uint8_t st = cfg.strobe_type; // can't use switch() on an enum
+ uint8_t st = current_strobe_type; // can't use switch() on an enum
switch(st) {
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
diff --git a/spaghetti-monster/anduril/strobe-modes.h b/spaghetti-monster/anduril/strobe-modes.h
index 9144d0e..127966b 100644
--- a/spaghetti-monster/anduril/strobe-modes.h
+++ b/spaghetti-monster/anduril/strobe-modes.h
@@ -30,6 +30,8 @@ typedef enum {
const int NUM_STROBES = strobe_mode_END;
+strobe_mode_te current_strobe_type;
+
// which strobe mode is active?
#ifdef USE_CANDLE_MODE
#define DEFAULT_STROBE candle_mode_e
diff --git a/spaghetti-monster/anduril/tactical-mode.c b/spaghetti-monster/anduril/tactical-mode.c
index 8f2e73d..0bcaaca 100644
--- a/spaghetti-monster/anduril/tactical-mode.c
+++ b/spaghetti-monster/anduril/tactical-mode.c
@@ -31,7 +31,7 @@ uint8_t tactical_state(Event event, uint16_t arg) {
} else { // momentary strobe mode
momentary_mode = 1;
if (lvl > RAMP_SIZE) {
- cfg.strobe_type = (lvl - RAMP_SIZE - 1) % strobe_mode_END;
+ current_strobe_type = (lvl - RAMP_SIZE - 1) % strobe_mode_END;
}
}
}
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.