3 ms·
Its quite common to use "while(true);" in the embedded world in order to trigger the hardware watchdog and cause a reset in a panic situation. It indicates tha
by TickleSteve 5y ago
Its quite common to use "while(true);" in the embedded world in order to trigger the hardware watchdog and cause a reset in a panic situation.
It indicates that the only sensible option is to reset the processor to get back to a known-good state.
This is pretty much how you handle unrecoverable errors in the embedded world where you must always take account of what happens in a reset condition for all situations and maintain 100% uptime because no one is going to reset it manually.
- KirillPanov 5y agoNo, it is not common at all. You simply jump to the watchdog interrupt handler, or execute the "reset the CPU" instruction. No need for such convoluted foolery with loops and timeouts to achieve exactly the same effect. Remember, embedded processors have no MMU -- there's no context switch when entering an interrupt handler.