From cfedb2eaf4a0d62969ff05307ac40d4f1cdab2d9 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 17 Jun 2018 18:18:38 -0600 Subject: Implemented halfsleep mode. Will probably change it quite a bit though, so I'm checking in changes first. Needs to be "tick during standby" instead of "half sleep". --- spaghetti-monster/fsm-standby.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'spaghetti-monster/fsm-standby.c') diff --git a/spaghetti-monster/fsm-standby.c b/spaghetti-monster/fsm-standby.c index b90ccea..8e51dda 100644 --- a/spaghetti-monster/fsm-standby.c +++ b/spaghetti-monster/fsm-standby.c @@ -31,7 +31,17 @@ #define standby_mode sleep_until_eswitch_pressed void sleep_until_eswitch_pressed() { + #ifdef USE_HALFSLEEP_MODE + //uint16_t sleep_counter = 0; + if (halfsleep_mode) { + // set WDT to slow mode + wdt_reset(); + WDTCR |= (1<