??? 03/15/07 20:41 Read: times |
#135064 - Be kind to animals Responding to: ???'s previous message |
Jez said:
I was discussing with someone at work where in the code you reset the watchdog timer, I have always been of the opinion that you only do it in the main loop, he was suggesting that you do it in the main loop and in the ISRs and anywhere else you can think of which seems to defeat the object somewhat. You're right. Your pal is wrong. You should kick the dog in as few places as you can get away with, and never inside an ISR if you can avoid it. If you kick the dog in the ISR for a timer interrupt, for example, it's entirely possible that the main loop can go off in the weeds while the timer and its interrupt continue to run normally. If the timer ISR is kicking the dog, then the watchdog reset will never occur and your gizmo will be hung as surely as if you had the watchdog disabled entirely. -- Russ |