Using the TRAP_PROC Pragma

The TRAP_PROC pragma informs the compiler that the following function is an interrupt function. In that case, the compiler terminates the function by a special interrupt return sequence (for many processors, an RTI instead of an RTS).

Listing: Example of using the TRAP_PROC pragma


#pragma TRAP_PROC
void INCcount(void) {

  tcount++;

}