From dac03ab316ed47aff8e1e28d357935c7e4cbda29 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 23 Aug 2021 04:24:08 -0600 Subject: moved jump start into FSM so it'll be more universal and the app won't need special clauses (also adjusted KR4 jump start levels a bit) --- spaghetti-monster/fsm-ramping.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spaghetti-monster/fsm-ramping.c') diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 017a5b8..54ca45c 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -24,6 +24,18 @@ #ifdef USE_RAMPING void set_level(uint8_t level) { + #ifdef USE_JUMP_START + // maybe "jump start" the engine, if it's prone to slow starts + // (pulse the output high for a moment to wake up the power regulator) + // (only do this when starting from off and going to a low level) + if ((! actual_level) + && level + && (level < jump_start_level)) { + set_level(jump_start_level); + delay_4ms(JUMP_START_TIME/4); + } + #endif // ifdef USE_JUMP_START + actual_level = level; #ifdef USE_SET_LEVEL_GRADUALLY -- cgit v1.2.3