@interrupt

Cosmic uses the @interrupt syntax, whereas this compiler employs the interrupt syntax. In order to keep the source base portable, a macro can be used (e.g., in a main header file which selects the correct syntax depending on the compiler used:

Listing: interrupt syntax


/* place the following in a header file: */

#ifdef __MWERKS__

  #define INTERRUPT interrupt

#else

  #define INTERRUPT @interrupt

#endif

/* now for each @interrupt we use the INTERRUPT macro: */

void INTERRUPT myISRFunction(void) { ...