I have aproblem with interrupt & goto statement

General discussion on mikroC.
Post Reply
Author
Message
Teeravisit
Posts: 3
Joined: 21 Mar 2012 11:21

I have aproblem with interrupt & goto statement

#1 Post by Teeravisit » 21 Mar 2012 11:29

At first I'm beginner with mcu world.
The following code, I try to stop Blink LED by using RB0 interrupts.
The compile is not pass. What is wrong?. Please help to explain.

void interrupt(void)
{
if(intcon.intf == 1){ goto stop;intcon.intf = 0;}
}

void main()
{
anselh.f4=0; //rb0 intrrupt
trisb.f0=1;
intcon=0b10010000;
trisd=0x00;
trisc.f1=1;

portd=0xaa;
while(1);
stop: portd=0xff;

}

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: I have aproblem with interrupt & goto statement

#2 Post by janko.kaljevic » 22 Mar 2012 10:17

Hello,

I believe that I have answered you here:
http://www.mikroe.com/forum/viewtopic.php?f=13&t=47537

Best regards.

Post Reply

Return to “mikroC General”