#include <nitro/os.h>
void OS_SetIrqFunction(
OS_IrqMask intrBit ,
OS_IrqFunction function );
Sets the interrupt handler
Sets the functions (interrupt handler) that jump when the designated IRQ interrupt occurs. In intrBit, the IRQ interrupt cause that sets the handler gets designated. In function, the handler gets designated.
For details about the IRQ interrupt cause, refer to OS_SetIrqMask().
The interrupt handler is in the form of OS_IrqFunction. This is a void function, without arguments.
(Example)
main() { : OS_InitIrqTable(); OS_SetIrqFunction( OS_IE_V_BLANK , vhandler ); : } void vhandler( void ) { // V-Blank interrupt process }
You need to be cautious about timer interrupts. Based on the hardware timer specifications, timer interrupts are configured dynamically. However, with the OS, the settings are released when the first interrupt occurs so only that first timer interrupt takes place. In order to perform repeated timer interrupts, processing to configure settings need to be done again in the interrupt handler.
intrBit |
The IRQ interrupt cause to be enabled (expressed as a logical sum) |
function |
The interrupt handler |
None
OS_SetIrqMask, OS_InitIrqTable, OS_GetIrqFunction
06/03/2004 Added caution about timer interrupts. 12/01/2003 Initial version