??? 04/02/10 14:27 Read: times |
#174778 - Watchdog kick in interrupts can often fail badly Responding to: ???'s previous message |
Baptiste Pomechicot said:
Why do you say it's better to feed watchdog in the infinite loop than to feed it in the interrupt handler ?
Thanks. Think what happens when you have a watchdog kick in an interrupt handler and your program locks up but the interrupt handler keeps getting activated? How much use do you then have of your watchdog? Having the watchdog kick in the main loop (which, by definition is an infinite loop, unless you have a device that runs a single action and then turns off the power, such as maybe an electric razor or similar) means that as long as it is kicking the watchdog, it is porbable that it is actually servicing the different actions listed in the main loop. Now, when you get a bit more experience, you will start looking about software development in a different way. You will no longer look at things and consider "works" or "doesn't work". You will also start to consider how well something works, and the probability of a failure. You will start thinking about electricl interference. The probability of introducing bugs when modifying code. Lifetime costs. It is a well known fact that what you know tends to be easy. But sometimes, the easy solution is a bad solution. Then it's time to try t learn more. |