Originally Posted by
Matticus
Your objection to the quoted line in my post is justified. You are correct that nested interrupts can sometimes occur, but only on certain systems that use prioritized interrupts. It is, however, generally considered bad practice to rely on this behavior. In such systems, the more interrupts that are enabled, the more difficult it is to model the behavior of the program. There may be so many possible variations of actions (if multiple interrupts of different priorities occur around the same time) that it makes predictability tremendously difficult.
But if a device does not use an interrupt priority scheme, or only interrupts of the same priority occur, then an ISR must complete before another interrupt is processed. If interrupts of the same priority could interrupt the ISR, then the ISR could never be executed, as it would restart the ISR each clock cycle. The ISR must ignore interrupts (of equal or lower priority) to allow the code to clear the necessary interrupt flag(s).