aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-07 13:52:38 -0700
committerSelene ToyKeeper2023-11-07 13:52:38 -0700
commit6dc5c9a5153add1887cb0fc976f16cf4cff06012 (patch)
tree8b52396ff73d66001a53d1d0077563753654a75e
parentfail pull requests if author accidentally committed a new version.h (diff)
parentAllow turbo in momentary mode (diff)
downloadanduril-6dc5c9a5153add1887cb0fc976f16cf4cff06012.tar.gz
anduril-6dc5c9a5153add1887cb0fc976f16cf4cff06012.tar.bz2
anduril-6dc5c9a5153add1887cb0fc976f16cf4cff06012.zip
Merge branch 'momentary-turbo' of github.com:SammysHP/anduril into pr-16-SammysHP-momentary-turbo
* 'momentary-turbo' of github.com:SammysHP/anduril: Allow turbo in momentary mode
-rw-r--r--ui/anduril/ramp-mode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/anduril/ramp-mode.c b/ui/anduril/ramp-mode.c
index 5ce1b54..bd82fbb 100644
--- a/ui/anduril/ramp-mode.c
+++ b/ui/anduril/ramp-mode.c
@@ -468,6 +468,11 @@ uint8_t steady_state(Event event, uint16_t arg) {
#ifdef USE_MOMENTARY_MODE
// 5 clicks: shortcut to momentary mode
else if (event == EV_5clicks) {
+ // Allow to use turbo in momentary mode. It is safe to overwrite
+ // memorized_level because the only way to exit momentary mode is to
+ // reboot the flashlight which restores memorized_level to the default
+ // or EEPROM (but we don't write to EEPROM here).
+ memorized_level = actual_level;
set_level(0);
set_state(momentary_state, 0);
return EVENT_HANDLED;