Re: Interrupt routine in XC8
2020/02/26 01:14:00
(permalink)
Hi I am using MP LAB IDE V5.30 AND XC8 V2.10
I am trying to write an interrupt service routine but it is giving me errors
this one : Interrupt.c:13:7: error: variable has incomplete type 'void'
please assist me
here is my code
void interrupt my_isr ()
{
if (INTCONbits.INT0IE==1)// if (INT0IE=1) to check if the PIR IS PRESSED FOR INTERRUPTION
{
for (int flahD2=0;flahD2 <5;flahD2++) // THE LED WILL FLAH 5 TIMES
{
LATBbits.LATB5=1;
for (int count =0;count<20;count++)__delay_ms(13);// delay for 330ms
LATBbits.LATB5=0;
for (int count=0;count <20;count++)__delay_ms(13);// delay for 330ms
}
}
INTCONbits.INT0IF =0;// clear the interrupt
}