TRAP_PROC

Generates instructions to allow a function to handle a processor exception.

Syntax
  #pragma TRAP_PROC
  
  
Remarks

Functions that act as interrupt service routines require special executable code to handle function entry and exit. Use this pragma to specify to the compiler that the subsequent function defintion will be used to handle processor exceptions.

Listing: Using the TRAP_PROC Pragma to Mark an Interrupt Function

#include <hidef.h> /* For interrupt macro. */

#pragma TRAP_PROC

void MyInterrupt(void) {

  DisableInterrupts;

  /* ... */

  EnableInterrupts;

}