Skip to main content

IAR Embedded Workbench for RISC-V 3.40

__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.

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.