diff options
Diffstat (limited to 'spaghetti-monster')
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 10 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-events.c | 12 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-main.c | 1 |
3 files changed, 11 insertions, 12 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 48f4ac1..19d61b7 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -2356,7 +2356,7 @@ void rgb_led_update(uint8_t mode, uint8_t arg) { void factory_reset() { // display a warning for a few seconds before doing the actual reset, // so the user has time to abort if they want - #define SPLODEY_TIME 3000 + #define SPLODEY_TIME 2500 #define SPLODEY_STEPS 64 #define SPLODEY_TIME_PER_STEP (SPLODEY_TIME/SPLODEY_STEPS) uint8_t bright; @@ -2364,9 +2364,9 @@ void factory_reset() { // wind up to an explosion for (bright=0; bright<SPLODEY_STEPS; bright++) { set_level(bright); - delay_4ms(SPLODEY_TIME_PER_STEP/2/4); + nice_delay_ms(SPLODEY_TIME_PER_STEP/2); set_level(bright>>1); - delay_4ms(SPLODEY_TIME_PER_STEP/2/4); + nice_delay_ms(SPLODEY_TIME_PER_STEP/2); if (! button_is_pressed()) { reset = 0; break; @@ -2387,14 +2387,14 @@ void factory_reset() { bright = MAX_LEVEL; for (; bright > 0; bright--) { set_level(bright); - delay_4ms(SPLODEY_TIME_PER_STEP/6/4); + nice_delay_ms(SPLODEY_TIME_PER_STEP/8); } } // explosion cancelled, fade away else { for (; bright > 0; bright--) { set_level(bright); - delay_4ms(SPLODEY_TIME_PER_STEP/3/4); + nice_delay_ms(SPLODEY_TIME_PER_STEP/3); } } } diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c index e125e84..a1b013a 100644 --- a/spaghetti-monster/fsm-events.c +++ b/spaghetti-monster/fsm-events.c @@ -110,7 +110,7 @@ uint8_t nice_delay_ms(uint16_t ms) { /* // delay_zero() implementation if (ms == 0) { CLKPR = 1<<CLKPCE; CLKPR = 0; // full speed - _delay_loop_2(BOGOMIPS*98/100/3); + _delay_loop_2(BOGOMIPS*95/100/3); return 1; } */ @@ -120,15 +120,15 @@ uint8_t nice_delay_ms(uint16_t ms) { uint8_t level = actual_level; // volatile, avoid repeat access if (level < QUARTERSPEED_LEVEL) { clock_prescale_set(clock_div_4); - _delay_loop_2(BOGOMIPS*98/100/4); + _delay_loop_2(BOGOMIPS*95/100/4); } //else if (level < HALFSPEED_LEVEL) { // clock_prescale_set(clock_div_2); - // _delay_loop_2(BOGOMIPS*98/100/2); + // _delay_loop_2(BOGOMIPS*95/100/2); //} else { clock_prescale_set(clock_div_1); - _delay_loop_2(BOGOMIPS*98/100); + _delay_loop_2(BOGOMIPS*95/100); } // restore regular clock speed clock_prescale_set(clock_div_1); @@ -136,13 +136,13 @@ uint8_t nice_delay_ms(uint16_t ms) { // underclock MCU to save power clock_prescale_set(clock_div_4); // wait - _delay_loop_2(BOGOMIPS*98/100/4); + _delay_loop_2(BOGOMIPS*95/100/4); // restore regular clock speed clock_prescale_set(clock_div_1); #endif // ifdef USE_RAMPING #else // wait - _delay_loop_2(BOGOMIPS*98/100); + _delay_loop_2(BOGOMIPS*95/100); #endif // ifdef USE_DYNAMIC_UNDERCLOCKING // run pending system processes while we wait diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c index a898f41..c9ab69b 100644 --- a/spaghetti-monster/fsm-main.c +++ b/spaghetti-monster/fsm-main.c @@ -123,7 +123,6 @@ int main() { #else delay_4ms(1); #endif - empty_event_sequence(); // fallback for handling a few things #ifndef DONT_USE_DEFAULT_STATE |
