Nios® V Processor Software Developer Handbook

ID 743810
Date 10/31/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

8.2.2. Writing a Hardware ISR

The hardware ISR you write must match the function prototype that alt_ic_isr_register() expects.
void (*alt_isr_func) (void* isr_context)

The parameter definition of isr_context is the same as for the alt_ic_isr_register() function.

From the point of view of the HAL exception handling system, the most important function of an ISR is to clear the associated peripheral’s interrupt condition. The procedure for clearing an hardware interrupt condition is specific to the peripheral.

When the ISR has finished servicing the hardware interrupt, it returns to the HAL interrupt funnel that called it.

Note: If you write your ISR in assembly language, use ret to return. The HAL general exception funnel issues an MRET after restoring the application context.