InterruptVector
 
Component InterruptVector
Interrupt vector handled in user code
Component Level: Peripheral Initialization
Typical Usage:
(Examples of a typical usage of the component in user code. For more information please see the page Component Code Typical Usage.)

Required component name is "IV1" and the ISR name is "OnInterrupt".

(1)
In the following example, program waits at least for 50 interrupt events:
Note: "__interrupt" is a target specific macro for the interrupt service routine.

 MAIN.C

unsigned int IntCnt=0;

__interrupt void OnInterrupt(void) 
{
  IntCnt++;        /* Increment counter */
}

void main(void)
{
  /* Wait for 50 events */
  while (IntCnt < 50); 
}