diff options
Diffstat (limited to 'spaghetti-monster/fsm-main.c')
| -rw-r--r-- | spaghetti-monster/fsm-main.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c index e537a9e..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 @@ -160,6 +159,9 @@ int main() { standby_mode(); } + // catch up on interrupts + handle_deferred_interrupts(); + // give the recipe some time slices loop(); @@ -168,4 +170,22 @@ int main() { } } + +void handle_deferred_interrupts() { + /* + if (irq_pcint) { // button pressed or released + // nothing to do here + // (PCINT only matters during standby) + } + */ + if (irq_adc) { // ADC done measuring + ADC_inner(); + // irq_adc = 0; // takes care of itself + } + if (irq_wdt) { // the clock ticked + WDT_inner(); + // irq_wdt = 0; // takes care of itself + } +} + #endif |
