Do interrupts block other interrupts? If I have an interrupt attached to two pins and the handler of the first is still executing when the second interrupt fires, does it:
a) queue the second interrupt,
b) ignore the second interrupt (missing it altogether), or
c) pause processing of the first interrupt to execute the second?
I am writing code that logs the exact time the interrupt occurs. Quite lightweight, but have three pins and am logging the rise and fall of each, so there is the potential for collisions. If a) then the second interrupt timestamp will be late, b) there is no timestamp for the later interrupt or c) the timing of the first and second interrupts will be ambiguous.
b) is the worst case, the other two are manageable.
It depends on the architecture.
Assuming AVR (8-bit Arduino) then it will queue the second interrupt until the first is finished.
It works by setting a flag in a register at the moment the interrupt occurs. Then between instructions it checks that flag and executes the associated interrupt routine. If an interrupt is in progress at the time the flag still gets set, but it is unable to check the state of that flag until after the current interrupt is over and normal execution occurs, at which point after the next instruction is completed it checks the interrupt flag statuses and runs the second interrupt routine.