I'm wondering if it is possible to detect where in a program a watchdog reset occurred?
I was thinking to have a global variable that I assign specific valuesin different sections of program where and when a watchdog reset might occur
then when a reset occurs, do the following:
- read MCUSR
- check watchdog bit
- if bit set, then read that global variable to determine reset location
main question is, will watchdog reset clear that variable? or is there a place where data can be saved before a watchdog reset?