From d32ae87d50e92cb59fdc28cf58622b32aede2f3e Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 26 Aug 2017 13:52:52 -0600 Subject: Avoid suspending at weird times by deferring the call to standby mode. Turned strobe into a function to avoid repeating code, and made it tolerate interruption better. Got rid of delay after battcheck, since it caused problems if the user didn't wait long enough before trying to turn the light back on. --- spaghetti-monster/fsm-adc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spaghetti-monster/fsm-adc.c') diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index 622ef0f..541f9a4 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -282,9 +282,13 @@ void battcheck() { for(i=0; voltage >= pgm_read_byte(voltage_blinks + i); i++) {} + #ifdef DONT_DELAY_AFTER_BATTCHECK + blink_digit(i); + #else if (blink_digit(i)) nice_delay_ms(1000); #endif + #endif } #endif -- cgit v1.2.3