Problems with compiling interrupt routine with XC8

Problems with compiling interrupt routine with XC8

Postby Andrea9765 » Sat Jan 05, 2019 6:27 pm

Hello, I'm trying to compile a project for PIC16F887 with XC8, this routine gives me some problems:

void interrupt isr(void)
{
if (SSPIF)
{
SSPIF = 0;
isrEnd = 1;
}
}

This is the error that the compiler gives me:

make[2]: *** [build/default/production/main.p1] Error 1
main.c:36:6: error: variable has incomplete type 'void'
void interrupt isr(void)
make[1]: *** [.build-conf] Error 2
^
make: *** [.build-impl] Error 2
main.c:36:15: error: expected ';' after top level declarator
void interrupt isr(void)
^
;
2 errors generated.
(908) exit status = 1

Anybody can help me ? Thanks very much
Andrea9765
 
Posts: 1
Joined: Sat Jan 05, 2019 2:49 pm

Re: Problems with compiling interrupt routine with XC8

Postby ric » Mon Jan 07, 2019 12:32 am

Which version XC8 are you using?
If it is XC8 v2.0, which mode? (C90 or C99?)
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 476
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: Problems with compiling interrupt routine with XC8

Postby Rusettsten » Sat Jan 19, 2019 9:19 am

You need to make the interrupt to be "void __interrupt() ISR (void)"
Rusettsten
 
Posts: 4
Joined: Sat Jan 19, 2019 12:11 am

Re: Problems with compiling interrupt routine with XC8

Postby ric » Sat Jan 19, 2019 9:24 am

Rusettsten wrote:You need to make the interrupt to be "void __interrupt() ISR (void)"

That's true if they are using C99 mode, hence my questions in the previous post, which are still unanswered.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 476
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to SCI/USART/EUSART

Who is online

Users browsing this forum: No registered users and 2 guests

cron