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

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

Re: [avr-gcc-list] Problem with interrupt handler?


From: Chris Baugher
Subject: Re: [avr-gcc-list] Problem with interrupt handler?
Date: Fri, 19 Oct 2001 10:53:36 -0500 (CDT)

On Fri, 19 Oct 2001, Joerg Wunsch wrote:

> Chris Baugher <address@hidden> wrote:
> 
> > static unsigned char ix=0;
> > 
> > SIGNAL(SIG_OVERFLOW0)
> > {
> >     ++ix;
> > }
> 
> Btw., the variable `ix' should be declared `volatile'.

Well, actually it will only be used in that ISR. And it needs to hold it's
value between calls, so it should really be local.

SIGNAL(SIG_OVERFLOW0)
{
    static unsigned char ix=0;

    ++ix;
}

C|

> 
> -- 
> J"org Wunsch                                         Unix support engineer
> address@hidden        http://www.interface-systems.de/~j/
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
> 




reply via email to

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