Galen Seitz wrote:
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.
Yes, but this doesn't save you the trouble of disabling interrupts
around the access to the variable in the main program, at which point
you'll probably want to write a special function to access it (so that
you don't sprinkle your code with interrupt disable / enable) at which
point you might as well stuff a volatile in there, and avoid changing
the interrupt code logic.
You can defend the use of volatile for 8 bit vars because all accesses
are atomic anyway, but when we reach 16 bits (or 32, ...) there really
isn't much point in _declaring_ the variable volatile at all, IMHO.
--
Paulo Marques - www.grupopie.com
"The face of a child can say it all, especially the
mouth part of the face."
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list