void HAL_IRQClear(int device)
Entry | |
---|---|
device | Device number to clear interrupt state for |
Exit | |
---|---|
- |
If the interrupt controller does not latch interrupt sources, and the HAL Video API is not implemented, this call does not need to be implemented.
If the interrupt controller does latch interrupt sources, this call must be implemented, to provide a way for those latches to be reset once the device has been serviced. Otherwise the ARM may receive spurious IRQs for devices which are no longer interrupting, or the system may become completely stuck attempting to serve the phantom IRQ.
RISC OS code which uses IRQs must make sure to call HAL_IRQClear once they have serviced the interrupting device – the OS will not call it for you.
If the HAL Video API is implemented, this call is expected to be capable of clearing any VSync IRQ that’s latched in the video controller. Previously, HAL_IRQClear was also responsible for clearing latched timer IRQs, but that responsibility has now fully shifted to HAL_TimerIRQClear (Note, however, that because interrupts may be latched in both the timer and the IRQ controller, timer code must call both entry points to ensure the interrupt state is cleared).