I read the datasheet and this question, but there's still something wrong here. Here my wdt init code:
cli();
MCUSR &= ~_BV(WDRF);
WDTCSR |= _BV(WDCE) | _BV(WDE);
WDTCSR = _BV(WDP2) | _BV(WDP1) | _BV(WDP0);
WDTCSR |= _BV(WDIF);
WDTCSR |= _BV(WDIE);
Leaving fire the wdt I expect it does nothing but set the WDIF
bit, instead it resets the MCU.
Is there something wrong in my approach?