Hello everyone,
I have a general question about disabling interrupts in ARM processors.
It is quite obvious that using the __disable_irq() in privileged mode should have the effect that no interrupt routines are called, but is the CPU still reactive to their triggering events by setting the interrupt flag? I would assume that it wouldn't, but need to know for sure.
Thanks, George
__disable_irq() sets the interrupt mask flag in CPSR, which prevents an ISR being called. It does not prevent the source of the interrupt requesting an interrupt. So if an interrupt condition occurs while interrupts are masked in CPSR, then that request will remain pending until the I flag is cleared in the CPSR, and an ISR will be called.
This is generally the desired behaviour - interrupt requests will be delayed but will still occur when interrupts are re-enabled. If you need to completely ignore interrupts that occurred while you had interrupts masked, then you would need to do extra work. Probably best to disable them at source before calling __disable_irq. Obviously need to re-enable afterwards...
Thanks for the informative answers!