commit d98a7cc40bbdc37d61d883b29c5af44e3e0c9ee5
parent 1a9c21f6cddeb5d7b00cca9f801ce1c3349252c2
Author: Kevin Pulo <kev@pulo.com.au>
Date: Wed, 18 May 2022 08:30:37 +1000
keyboard-fw: don't disable WDT during its interrupt handler
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/reform2-keyboard-fw/keyboard.c b/reform2-keyboard-fw/keyboard.c
@@ -342,7 +342,7 @@ void setup_hardware(void)
ISR(WDT_vect)
{
// WDT interrupt enable and flag cleared on entry
- wdt_disable(); // Disable watchdog for now
+ Delay_MS(1);
}
/** Event handler for the library USB Connection event. */
diff --git a/reform2-keyboard-fw/powersave.c b/reform2-keyboard-fw/powersave.c
@@ -60,6 +60,7 @@ void keyboard_power_off(void)
sleep_cpu(); // Actually go to sleep
// Zzzzzz
sleep_disable(); // We've woken up
+ wdt_disable(); // Disable watchdog for now
sei();
// Check if circle key has been pressed (active-low)
// If not reset the watchdog and try again