Reputation: 743
Having problems with this part of the code: void interrupt ISR_Timer0_Int
mplabs x ide 5.10 show error:
newmain.c:26:6: error: variable has incomplete type 'void'
newmain.c:26:15: error: expected ';' after top level declarator
I am using XC8 V2 compiler and it is going into a PIC18f4550
Code:
void interrupt ISR_Timer0_Int() // Timer0 Interrupt Service Routine (ISR)
{
if (INTCONbits.TMR0IF) // TMR0IF:- Timer0 Overflow Interrupt Flag Bit
// 1 = TMR0 reg has overflowed
// 0 = TMR0 reg has not overflowed
{
TMR0H = 0xED; // Timer0 start value = 0x48E5 for 0.1 second
TMR0L = 0x4C;
if (j <= 7) { //limit up to 7
j++; // Increase count by 1
PORTD = j; // Output to Demultiplexer
}
else {
j = 0; // Reset count aftwr it hit 7
PORTD = j; // Output to Demultiplexer
}
INTCONbits.TMR0IF = 0; // Reset TMR0IF to "0" since the end of
// the interrupt function has been reached
}
}
Upvotes: 0
Views: 3059
Reputation: 1570
The syntax changed with the new compiler. More info on this and links to the documentation can be found here https://www.microforum.cc/topic/5-i-used-to-use-to-locate-variables-but-since-xc8-20-this-is-no-longer-working/
You can get your old code to compile as explained in that link by setting the compiler back to C90 mode or by using the new interrupt syntax.
Upvotes: 1