From 41189343748b60ace6a72b4dfe85e85efcb99695 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 12 Aug 2021 03:02:50 -0600 Subject: added a "jump start moon" option for hold-from-off, for lights with slow-activating circuits (briefly pulses the light at a higher level to wake up the circuit faster) --- spaghetti-monster/anduril/off-mode.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/off-mode.c b/spaghetti-monster/anduril/off-mode.c index ae54f60..b1faf47 100644 --- a/spaghetti-monster/anduril/off-mode.c +++ b/spaghetti-monster/anduril/off-mode.c @@ -96,6 +96,12 @@ uint8_t off_state(Event event, uint16_t arg) { #if (B_TIMING_ON == B_PRESS_T) // hold (initially): go to lowest level (floor), but allow abort for regular click else if (event == EV_click1_press) { + #ifdef JUMP_START_MOON + if (!arg) { + set_level(JUMP_START_MOON); + delay_4ms(3); + } + #endif set_level(nearest_level(1)); return MISCHIEF_MANAGED; } @@ -110,6 +116,13 @@ uint8_t off_state(Event event, uint16_t arg) { } else #endif #else // B_RELEASE_T or B_TIMEOUT_T + #ifdef JUMP_START_MOON + // pulse the output for a moment to wake up the power regulator + if (!arg) { + set_level(JUMP_START_MOON); + delay_4ms(3); + } + #endif set_level(nearest_level(1)); #endif // don't start ramping immediately; -- cgit v1.2.3