Writing an Interrupt Service Routine #706
-
I was looking at the disassembled code from the ISR of the SPI IRQ demo program and it does not appear to save the registers or use the mret. Is this correct?
I found that if I add the following declaration before the spi_irq_handler the registers will be saved and the routine exits with a mret.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @e76nystrom!
Yes, this is correct. This "interrupt service routine" is not a "real" interrupt service routine. 😅 It is just a normal function that is called by the actual interrupt service routine, which is buried in the NEORV32 Runtime Environment (RTE). All the register saving as well as the termination of the interrupt handler via You can find more in-depth information about the RTE in the online data sheet: 📚 NEORV32 Runtime Environment |
Beta Was this translation helpful? Give feedback.
Hey @e76nystrom!
Yes, this is correct.
This "interrupt service routine" is not a "real" interrupt service routine. 😅 It is just a normal function that is called by the actual interrupt service routine, which is buried in the NEORV32 Runtime Environment (RTE). All the register saving as well as the termination of the interrupt handler via
mret
is done by the RTE.You can find more in-depth information about the RTE in the online data sheet: 📚 NEORV32 Runtime Environment