aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-08-30 22:16:37 -0600
committerSelene ToyKeeper2017-08-30 22:16:37 -0600
commitf881184e490bc13bb5d2436fc67ede0c1eb0c4c0 (patch)
tree861344c11023c306bcec260f8b01fc5f9825b0b7
parentAdded goodnight mode. Rearranged blinkies in battcheck group. (diff)
downloadanduril-f881184e490bc13bb5d2436fc67ede0c1eb0c4c0.tar.gz
anduril-f881184e490bc13bb5d2436fc67ede0c1eb0c4c0.tar.bz2
anduril-f881184e490bc13bb5d2436fc67ede0c1eb0c4c0.zip
Made event handling a bit more reliable while asleep.
(was sometimes having difficulty getting out of soft lockout mode)
-rw-r--r--spaghetti-monster/fsm-standby.c4
1 files changed, 3 insertions, 1 deletions
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();
}