10.14.2 Interrupt Service Routine

The method used to declare an ISR and initialize the IVT/RIVT with the correct vector address depends on the programming language (C or Assembly) and the language development tool suite used to develop the application.

In general, the user application must clear the interrupt flag in the appropriate IFSx register for the source of the interrupt that the ISR handles. Otherwise, the application will re-enter the ISR immediately after it exits the routine. If the ISR is coded in Assembly language, it must be terminated using a RETFIE instruction to unstack the saved PC value, SRL value and old CPU priority level.