Search code examples
cinterruptinterrupt-handlingisr

Does an interrupt handler have a timeout?


Testing a code that uses interrupts, I forced with a while(1); to try to remain in the interrupt handler, but I saw that the interrupt handler leaves and returns to main, so I assume it has some kind of timeout. If so, is it particular to the ISR, or it is a standard feature of interrupts?


Solution

  • It is not a standard feature of interrupts. You don't say what platform you are using, but in general, interrupt handlers should do only what is necessary, and return. The less time spent in the handler, the better.

    It is possible your program has a watchdog timer somewhere, and when starved for processing time (because the ISR hung), the timer fires and is designed to exit your program.