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

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

Re: [avr-gcc-list] volatile...


From: Galen Seitz
Subject: Re: [avr-gcc-list] volatile...
Date: Fri, 15 Dec 2006 09:46:26 -0800
User-agent: Thunderbird 1.5.0.8 (X11/20061109)

One more suggestion...

If you are using global volatiles shared between an interrupt and mainline code, interrupt handler performance may be improved by moving the volatile into a temporary variable.

galen


volatile uint16_t counter;

SIGNAL(TMR0_OVERFLOW)
{
    uint16_t tmp;

    tmp = counter;
    tmp++;
    if (tmp == 100)
        tmp = 0;
    counter = tmp;
}





reply via email to

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