All,
I've got a question regarding the code that's linked to in a few spots on the forums and maybe even in the playground:
http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/
From what I can tell, the loop function here is checking if their watchdog flag, f_wdt, is equal to 1, if so it does some stuff like reads a sensor, sets the watchdog flag to 0, and then goes to sleep. The watchdog interrupt function sets the flag to 1, and the whole process starts over again. So my question is this. Does that watchdog timer flag really do anything? They're initializing it to 1, so it goes in on the first pass, and then they manually call sleep, which of course means the interrupt function is going to set it to 1. Is there really a point to that in their particular example.
Reason for the question is I have a sketch that puts my board to sleep using the code from this sketch and after a while of sleeping/waking it "hangs" and I have no idea what it's doing. Now it could be some other problems so I've removed my sleep and am testing over night, but thought I'd ask about this flag thing since I couldn't find any use for it so I didn't use it. I have my interrupt function doing nothing.
Thanks.