----- Original Message -----
From: "E. Weddington" <address@hidden>
Date: Monday, March 14, 2005 11:38 am
Subject: Re: [avr-gcc-list] efficiency of assigning bits
To clear bit 0 and set bits 1,2,3 without disturbing the other bits:
PORTD = (PORTD & ~(_BV(0))) | (_BV(1)|_BV(2)|_BV(3));
Thanks that is working!
I noticed this in the avr-libc usermanual FAQ:
"http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_intpromote"
So would it be a good idea (for saving uC time) to convert that above
line to this:
PORTD = (PORTD & (unsigned char)~(_BV(0))) | (unsigned
char)_BV(1)|_BV(2)|_BV(3));