4.29 vector Pragma
The IAR vector
pragma sets the interrupt number associated with the following
interrupt handler function.
Suggested Replacement
Remove the pragma and ensure that the vector number has been specified as the
argument to the __interrupt
qualifier used with the interrupt
function.
Caveats
None
Examples
Consider migrating IAR code such
as:
volatile int x;
#pragma vector=2
void __interrupt incIsr(void) {
x++;
}
to
MPLAB XC8 code similar
to:#include <xc.h>
volatile int x;
void __interrupt(2) incIsr(void) {
x++;
}
Further Information
See the Interrupts section in the MPLAB XC8 C Compiler User's Guide for AVR MCUs for more information on writing interrupt functions.