Skip to main content

IAR Embedded Workbench for RX 5.20

__interrupt

In this section:
Syntax

See Syntax for type attributes used on functions.

Description

The __interrupt keyword specifies interrupt functions. To specify one or several interrupt vectors, use the #pragma vector directive. The range of the interrupt vectors depends on the device used. It is possible to define an interrupt function without a vector, but then the compiler will not generate an entry in the interrupt vector table.

An interrupt function must have a void return type and cannot have any parameters.

The header file iodevice.h, where device corresponds to the selected device, contains predefined names for the existing interrupt vectors.

Tip

To make sure that the interrupt handler executes as fast as possible, you should compile it with -Ohs, or use #pragma optimize=speed if the module is compiled with another optimization goal.

Example
#pragma vector=0x14
__interrupt void my_interrupt_handler(void);
See also

Interrupt functions, vector, and .inttable.