From a53bb0d6b38bfc187460fadf06f34014e71a3683 Mon Sep 17 00:00:00 2001 From: SammysHP Date: Thu, 24 Dec 2020 20:27:10 +0100 Subject: Allow turbo in momentary mode --- ui/anduril/ramp-mode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui') 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; -- cgit v1.2.3