Hello, all. I'm a bit confused by many of the comments in this
thread. Where is there a guarentee that the two bits will be
set at the same time in any of the shown examples?
If I understand correctly, any of:
PORTD &= ~_BV(PD1);
PORTD &= ~_BV(PD4);
or
PORTD &= ~(_BV(PD1) | _BV(PD4));
or other variants are completely the same in what kind of code
they may generate when it gets down to machine language, no?
There is no implied simultinaity in any of these statements--
all C offers you is that the user code won't be able to tell
the difference--unless PORTD is defined as a volatile. Which
may be the default and would explain my confusion.
Is that the critical bit that I'm missing?