fixes
This commit is contained in:
@@ -56,9 +56,11 @@ void wdt_isr_enable(void)
|
||||
MCUSR &= ~(1 << WDRF);
|
||||
WDTCSR = (1 << WDCE) | (1 << WDE);
|
||||
|
||||
// WDP[3:0] = 0b011 -> 0.125 s. Interrupt mode only (WDE clear), so an
|
||||
// expiry wakes us to clear the debounce instead of resetting the part.
|
||||
WDTCSR = (1 << WDIE) | (1 << WDP1) | (1 << WDP0);
|
||||
// WDP[3:0] = 0b010 -> 64 ms debounce, capping the count at ~15 rev/s;
|
||||
// a reed contact settles in a few ms, so this is generous. Interrupt mode
|
||||
// only (WDE clear): an expiry wakes us to clear the debounce instead of
|
||||
// resetting the part.
|
||||
WDTCSR = (1 << WDIE) | (1 << WDP1);
|
||||
|
||||
SREG = sreg; // Restore, never blanket-sei(): these run inside an ISR
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user