From 667d789caf9b425f2fb1105d47b8aff8c2091ecb Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 30 Jun 2018 19:42:05 -0600 Subject: Fixed bug: moon mode flickered a bit in momentary mode due to constant MCU clock speed adjustments. (also, reduced code size and made it harder for similar bugs to appear in the future) --- spaghetti-monster/anduril/anduril.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 0766361..ab6a0af 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1670,16 +1670,6 @@ void loop() { #endif if (0) {} - #ifdef USE_IDLE_MODE - else if ( (state == steady_state) - || (state == off_state) - || (state == lockout_state) - || (state == goodnight_state) ) { - // doze until next clock tick - idle_mode(); - } - #endif - if (state == strobe_state) { uint8_t st = strobe_type; // bike flasher @@ -1777,4 +1767,12 @@ void loop() { set_level(0); nice_delay_ms(((beacon_seconds) * 1000) - 500); } + + #ifdef USE_IDLE_MODE + else { + // doze until next clock tick + idle_mode(); + } + #endif + } -- cgit v1.2.3