[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Re: [avr-gcc-list] efficiency of assigning bits

From: Royce & Sharal Pereira
Subject: Fwd: Re: [avr-gcc-list] efficiency of assigning bits
Date: Tue, 15 Mar 2005 00:51:16 +0530
User-agent: Opera M2(BETA2)/8.0 (Win32, build 7483)

------- Forwarded message -------

I am assuming these are equivalent.

Not quite. Do this:

PORTD &= ~(_BV(PD1) | _BV(PD4));

That will clear the two bits at the same time.
or, PORTD &= ~((1<<1) | (1<<4)); //to bypass the _BV stuff,
or, PORTD &= ~(3<<1);
or, PORTD &= ~6; //cryptic but less typing.
or, PORTD &= 0xf9; //--ditto--


Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]