diff --git a/main.c b/main.c index 2a50ae0..a61160d 100644 --- a/main.c +++ b/main.c @@ -126,6 +126,18 @@ ISR(TIMER1_OVF_vect) } } +/* + * For newer devices (mega88) the watchdog timer remains active even after a + * system reset. So disable it as soon as possible. + * automagically called on startup + */ +void get_mcusr(void) __attribute__((naked, section(".init3"))); +void get_mcusr(void) +{ + MCUSR = 0; + WDTCSR = (1<