Changed the bits according to the spec of the xc8 compiler, liek Still showing errors with Xc8 compilers too, with 16 bit shifts, unknown pragmas etc.
Code:
void CANISR(void)
{
unsigned char TempCANCON;
if(PIR5 & PIE5)
{
TempCANCON = CANCON;
// PIE.RXB0IE=0;
if(PIR5bits.RXB0IF && PIE5bits.RXB0IE)
{
RXB0IF = 0; //Clear interrupt flag
CANCON = CANCON & 0xF0 | RXB0Interrupt;
CANGetMessage();
}
else if(RXB1IF && PIE5bits.RXB1IE)
{
RXB1IF = 0; //Clear interrupt flag
CANCON = CANCON & 0xF0 | RXB1Interrupt;
CANGetMessage();
}
else if(TXB0IF && PIE5bits.TXB0IE)
{
CANCON = CANCON & 0xF0 | TXB0Interrupt;
if(CANPutMessage())
PIE5bits.TXB0IE = 0;
else
TXB0IF = 0;
}
else if(TXB1IF && PIE5bits.TXB1IE)
{
CANCON = CANCON & 0xF0 | TXB1Interrupt;
if(CANPutMessage())
PIE5bits.TXB1IE = 0;
else
TXB1IF = 0;
}
else if(TXB2IF && PIE5bits.TXB2IE)
{
CANCON = CANCON & 0xF0 | TXB2Interrupt;
if(CANPutMessage()) //if there wasn't any more messages to send
PIE5bits.TXB2IE = 0; //disable interrupts for TXB2 and leave TXB2IF
else //still on so PutCAN() can reenable the interrupt and instantly vector to ISR
TXB2IF = 0; //message was sent, just clear the interrupt flag.
}
else if(ERRIF && ERRIE)
{
ERRIF = 0; //Clear interrupt flag
#ifdef CAN_ERROR_HANDLER_ENABLE
CANErrorHandler();
#endif
//No error handler implemented!!!
}
else if(WAKIF && WAKIE)
{
WAKIF = 0; //Clear interrupt flag
}
CANCON = TempCANCON;
}
}
Build E:\123\123 for device 18F25K80
Using driver C:\Program Files\Microchip\xc8\v1.12\bin\xc8.exe
Make: The target "E:\123\UARTIntC.p1" is out of date.
Executing: "C:\Program Files\Microchip\xc8\v1.12\bin\xc8.exe" --pass1 E:\123\UARTIntC.c -q --chip=18F25K80 -P --runtime=default --opt=default -N-1 -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [100] ; . unterminated #if[n][def] block from line 49
(908) exit status = 1
Make: The target "E:\123\Can.p1" is up to date.
Make: The target "E:\123\CANInt.C18.ex.p1" is out of date.
Executing: "C:\Program Files\Microchip\xc8\v1.12\bin\xc8.exe" --pass1 E:\123\CANInt.C18.ex.c -q --chip=18F25K80 -P --runtime=default --opt=default -N-1 -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Warning [335] E:\123\CANInt.C18.ex.c; 6.1 unknown pragma "interrupt"
Warning [335] E:\123\CANInt.C18.ex.c; 12.1 unknown pragma "code"
Error [195] E:\123\CANInt.C18.ex.c; 15.1 expression syntax
Error [312] E:\123\CANInt.C18.ex.c; 16.1 ";" expected
Warning [335] E:\123\CANInt.C18.ex.c; 19.1 unknown pragma "code"
(908) exit status = 1
********** Build failed! **********
this is the output that I get from the build output