Background
I was wondering if using ticker
interrupts could interfere with hardware interrupts triggered by a button press.
Example
Imagine I would like to use these two types of interrupts:
- a
ticker
timer to update a progress bar on a small display everyn
second - a
hardware interrupt
that starts/stops the process whose progress is displayed if the user presses a button
Important: Both interrupts set shared global volatile
flags.
Main question
Would it be possible for the ticker
interrupt to occur during a button induced interrupt and as a result for the program to end up in a state where the global flags are set contradictorily?
More specific questions
Does a hardware and a software interrupt have the same 'rank'?
If they occured at the same time, would the interrupt request occurring slightly later (but still overlapping with the first one) be ignored, or just put into a queue and execute straight after the first interrupt has finished? In this case, the flags would be set in an unexpected manner.
Can I disable one type of the interrupts inside the other type's ISR - i.e. ignore it?
I hope the problem statement is clear enough even without a code example.