narithota
Full Member level 1
Hi
Can I use GOTO statement in interrupt routine?
Example code is:
#include <REG51.H>
void ex0_isr (void) interrupt 0
{
goto NEXT;
}
void main(void)
{
IT0 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2)
EX0 = 1; // Enable EX0 Interrupt
EA = 1; // Enable Global Interrupt Flag state
While(1)
{
; ; /* interrupt well occur in this loop after that it should goto to next loop */
}
NEXT while(1)
{
; ;
}
}
Normally interrupt well occur in one loop after excuting the interrupt service routine
Again it well come to same loop.But my use is interrupt should come in one loop after that it should goto to next loop that’s why here iam using GOTO state ment.
My compiler is showing fallowing error:
INTEREX1CODE.C (14): error C233: 'NEXT': undefined label
Thanks
Regards
Nari
Can I use GOTO statement in interrupt routine?
Example code is:
#include <REG51.H>
void ex0_isr (void) interrupt 0
{
goto NEXT;
}
void main(void)
{
IT0 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2)
EX0 = 1; // Enable EX0 Interrupt
EA = 1; // Enable Global Interrupt Flag state
While(1)
{
; ; /* interrupt well occur in this loop after that it should goto to next loop */
}
NEXT while(1)
{
; ;
}
}
Normally interrupt well occur in one loop after excuting the interrupt service routine
Again it well come to same loop.But my use is interrupt should come in one loop after that it should goto to next loop that’s why here iam using GOTO state ment.
My compiler is showing fallowing error:
INTEREX1CODE.C (14): error C233: 'NEXT': undefined label
Thanks
Regards
Nari