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
I have a general question about disabling interrupts
most processors, ARM or not, have, for purposes of synchronization, a two step interrupt process. step1: set a flag "interrupt request" step2" if "interrupt request" active, interrupt most processors, ARM or not, will, when interrups are disabled, do step 1 but hold step2 till the interrupt is enabled again.
I say "most" because I can not claim to know them all, but as to my recollection the word is not "most" but "all"
Erik
PS if you do not want an interrupt, where step 1 occurred during disable, to occur when you enable, the process is clear "interrupt request" flag ebanble interrupt
PPS I/O is quite different between ARM processors, so for a definite answer you must specify the actual dvice
__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!