On Tue, Mar 01, 2011 at 03:11:14PM +0100, [email protected] wrote: > On Wed, 2 Mar 2011 01:04:44 +1100 > Erik Christiansen <[email protected]> wrote: > > > IANA "volatile" expert, but understand that "[hardware|other thread] > > may change the value while this code is executing" is a legitimate > > view of the compiler's perspective. In that case, the whole value > > must be read and rewritten, to avoid composite values, partly > > software created, and partly hardware-(or alternate thread)-written. > > reading and writing only some bytes is not a reliable option with a > > predictable outcome. > > OK, neither am I a. But if the whole value must be read and rewritten > the compiler better insert interrupt disable/enable for volatiles > larger than 8 bits.
If that isn't needed, then it's not a volatile, I think. (Because it's in RAM, so only another thread/ISR can intrude. Hardware writes don't apply in this case.) Erik _______________________________________________ AVR-chat mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat
