From 8d967e13f18cee2bc13faa502cfac0946ae2a0d9 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 21 Oct 2017 06:46:07 -0600 Subject: Delay un-setting go_to_standby until the last moment, in case set_level() wants to use it. --- spaghetti-monster/fsm-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c index 5efcd4c..8f21846 100644 --- a/spaghetti-monster/fsm-main.c +++ b/spaghetti-monster/fsm-main.c @@ -110,7 +110,6 @@ int main() { // enter standby mode if requested // (works better if deferred like this) if (go_to_standby) { - go_to_standby = 0; #ifdef USE_RAMPING set_level(0); #else @@ -127,6 +126,7 @@ int main() { PWM4_LVL = 255; // inverted :( #endif #endif + go_to_standby = 0; standby_mode(); } -- cgit v1.2.3