avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] use of GOTO statement


From: stevech
Subject: Re: [avr-gcc-list] use of GOTO statement
Date: Thu, 11 Aug 2005 12:07:55 -0700

If you want the non-interrupt software to change what it is executing based on getting/processing an interrupt, then the C language goto is not the correct concept. The common way to do what you want is to implement a finite state machine in the non-interrupt section of your system software. The interrupt service routines set flags or other mechanisms and exit the interrupt as usual. The non-interrupt code looks at this variable and branches accordingly. The non-interrupt level code also disables interrupts briefly while altering this variable to provide mutual exclusion with an interrupt routine which may alter this variable. An Interrupt routine could alter the return PC, but this is poor form and will very likely lead to an unreliable design.

 

----- Original Message -----

From: juan antonio jimenez martinez <address@hidden>

Date: Thursday, August 11, 2005 10:45 am

Subject: [avr-gcc-list] use of GOTO statement

> Hi, Im working with the usart interruption in an ATMEGA8, my
> question is,
> how can I use the GOTO statemente to change the return address
> from my
> interrupt routine.
>
> thanks
>
> Antonio Jimenez
>
> _________________________________________________________________
> Platica con tus amigos en linea con T1msn Messenger
> http://messenger.t1msn.com.mx/
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
reply via email to

[Prev in Thread] Current Thread [Next in Thread]