# OS_SetIrqFunction

## Syntax

  `#include <nitro/os.h>`
  `void OS_SetIrqFunction( OSIrqMask intr, OSIrqFunction function );`

## Arguments

intr | The IRQ interrupt cause(s) to set.
function | Interrupt handler.

## Return Values

None.

## Description

This function sets the interrupt handler.

This function sets the function (that is, the interrupt handler) to which control jumps when the specified IRQ interrupt(s) occur. In intr, specify the IRQ interrupt cause for which to set a handler. In function, specify the handler.

The interrupt handler belongs to the `OSIrqFunction` type . It is a `void` function, without arguments.

###
Types of Interrupts

See below for information on the types of interrupts.

? Types of Interrupts

###
For example:

> `main()
> {
> :
> OS_InitIrqTable();
> OS_SetIrqFunction( OS_IE_V_BLANK, vhandler );
> :
> }
> void vhandler( void )
> {
> // V-Blank interrupt process
> }`

###
Note:

You need to be cautious about timer interrupts. With the hardware timer specifications, the set timer interrupts are generated repeatedly. With the OS, the settings for the registered handler are released when the first interrupt is generated, so only that first timer interrupt is generated. To generate repeated timer interrupts, processing to carry out settings needs to be done again in the interrupt handler.

## See Also

`OS_SetIrqMask`, `OS_InitIrqTable`, `OS_GetIrqFunction`

## Revision History

2005/03/08 Standardized the Japanese term for "interrupt."
2004/06/03 Added note about timer interrupts.
2003/12/01 Initial version.

CONFIDENTIAL