Very quick question about interrupts

Hi all,

Let's say in a section of your code, you have delay (10000). While in the middle of the delay, and interrupt pin meets its requirements (CHANGE, LOW, etc.). Does the Arduino stop the delay timer, run the interrupt, and then come back? Or does it avoid the interrupt until the delay is ran?

Thank you.

the interrupt is processed immediately without stopping the delay timer.

if the delay ends while the ISR is active, the code following the delay will be delayed until the ISR complete

Let's say in a section of your code, you have delay (10000).

Don't let's say that. Rather, let's suppose that you manage the pause without using the delay() function, then the question of what happens if/when an interrupt occurs does not arise

Got it, thank you all!

gcjr:
the interrupt is processed immediately without stopping the delay timer.

if the delay ends while the ISR is active, the code following the delay will be delayed until the ISR complete

No, the interrupt that updates the millis() timer is deferred during the ISR. Thus, neither millis() nor the delay count advances. So, when the ISR exits, the delay() will continue where it left off with no "credit" for the time spend in the ISR.

Caveat -- I'm talking AVR here.

an interrupt doesn't interrupt an ISR. right?

the interrupt that updates the millis() timer is deferred during the ISR. Thus, neither millis() nor the delay count advances.

does deffered mean it will be delayed until any currently running ISR completes. pending interrupts will be invoked ISR completes

gcjr:
an interrupt doesn't interrupt an ISR. right?

It can do, if you want it to.

doesn't that require special action, such as re-enabling interrupts from within your ISR?

Yes, hence the "if you want it to"