[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] efficiency of assigning bits
From: |
Jamie Morken |
Subject: |
Re: [avr-gcc-list] efficiency of assigning bits |
Date: |
Thu, 17 Mar 2005 14:13:19 -0800 |
Hi,
----- 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));
cheers,
Jamie Morken
- Re: [avr-gcc-list] efficiency of assigning bits, (continued)
- Re: [avr-gcc-list] efficiency of assigning bits, Parthasaradhi Nayani, 2005/03/13
- Re: [avr-gcc-list] efficiency of assigning bits, Jamie Morken, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits,
Jamie Morken <=
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/17
- Re: [avr-gcc-list] efficiency of assigning bits, Royce & Sharal Pereira, 2005/03/17
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, Ned Konz, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, Royce & Sharal Pereira, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, Dave Hansen, 2005/03/18
- Re: [avr-gcc-list] efficiency of assigning bits, David Brown, 2005/03/21
- Re: [avr-gcc-list] efficiency of assigning bits, Dave Hansen, 2005/03/21