From f881184e490bc13bb5d2436fc67ede0c1eb0c4c0 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 30 Aug 2017 22:16:37 -0600 Subject: Made event handling a bit more reliable while asleep. (was sometimes having difficulty getting out of soft lockout mode) --- spaghetti-monster/fsm-standby.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster/fsm-standby.c') diff --git a/spaghetti-monster/fsm-standby.c b/spaghetti-monster/fsm-standby.c index bef0533..86c5f0d 100644 --- a/spaghetti-monster/fsm-standby.c +++ b/spaghetti-monster/fsm-standby.c @@ -36,6 +36,7 @@ void sleep_until_eswitch_pressed() // make sure switch isn't currently pressed while (button_is_pressed()) {} + empty_event_sequence(); // cancel pending input on suspend PCINT_on(); // wake on e-switch event @@ -45,7 +46,8 @@ void sleep_until_eswitch_pressed() // something happened; wake up sleep_disable(); - PCINT_on(); + //PCINT_on(); // should be on already + // FIXME? if button is down, make sure a button press event is added to the current sequence ADC_on(); WDT_on(); } -- cgit v1.2.3