diff options
| author | Selene ToyKeeper | 2019-11-14 01:52:50 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-11-14 01:52:50 -0700 |
| commit | 8b59e880614455bd7bc7d8595de847dd6fe9b5b2 (patch) | |
| tree | a7426296b9fa1471ba2841eba0415bbfaed3e5c7 /spaghetti-monster/fsm-wdt.h | |
| parent | fixed some compile issues related to delay_4ms() (diff) | |
| download | anduril-8b59e880614455bd7bc7d8595de847dd6fe9b5b2.tar.gz anduril-8b59e880614455bd7bc7d8595de847dd6fe9b5b2.tar.bz2 anduril-8b59e880614455bd7bc7d8595de847dd6fe9b5b2.zip | |
refactored how interrupts work...
set a flag and return immediately,
then handle the actual logic later during a less-critical code path
Enables smarter responses to standby wakeups.
Seems to fix missed button presses during standby,
and most of the too-fast sleep ticks.
Also eliminated waits from button state measurement, so it can happen easier during standby.
(also eliminates the chance of an infinite loop on extra-noisy hardware)
Also might improve timing-sensitive interrupts like attiny85 PWM channel 4,
or a PWM-DSM hybrid technique I'd like to try.
BUT this change also appears to break the thermal sensor, so that needs to be fixed.
Diffstat (limited to 'spaghetti-monster/fsm-wdt.h')
| -rw-r--r-- | spaghetti-monster/fsm-wdt.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spaghetti-monster/fsm-wdt.h b/spaghetti-monster/fsm-wdt.h index 78fe791..d127551 100644 --- a/spaghetti-monster/fsm-wdt.h +++ b/spaghetti-monster/fsm-wdt.h @@ -25,9 +25,9 @@ void WDT_on(); inline void WDT_off(); -#ifdef TICK_DURING_STANDBY -volatile uint8_t f_wdt = 0; +volatile uint8_t irq_wdt = 0; // WDT interrupt happened? +#ifdef TICK_DURING_STANDBY #if defined(USE_INDICATOR_LED) || defined(USE_AUX_RGB_LEDS) // measure battery charge while asleep #define USE_SLEEP_LVP |
