In addition (and this is, well, a bit hidden in the docs, and comes
out rather unexpectedly at first), the WDRF bit in MCU[C]SR, while
active (indicating a watchdog reset happened), prevents the watchdog
from being disabled.  Thus, a simple wdt_disable() is not sufficient
after a watchdog reset.  You *must* clear WDRF at some point before
that.

Ah, that's it.  wdt_disable() at the top of main() on the old
architecture is sufficient.  I guess *reading* wdt.h instead of
*skimming* wdt.h would be advised.  In hindshight I realised I opened
wdt.h mostly to make sure #ifdef Mega168 was in it and glossed over
the commentary.

Thanks,
Steve


_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to