[Top][All Lists]

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

Re: [avr-libc-dev] RFC: avr/bits.h

From: E. Weddington
Subject: Re: [avr-libc-dev] RFC: avr/bits.h
Date: Tue, 01 Mar 2005 14:35:06 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Nicolas Schodet wrote:


About bit manipulations, I had a bad experience last week. On some
registers, bit manipulation can be tricky:

TWCR &= ~(_BV (TWSTA) | _BV (TWSTO));

The interrupt flag bit is read as 1, and writen at 1, this clear the
interrupt bit! A warning could be added to the manual.
No, the warning is already included in the datasheet for those items, specifically the TWI subsystem.

Another question about bit manipulation: what is the best way to read 4
bytes into a double word?
Use a union. This has been discussed before. See the archives.

This could also be included in the bit
manipulation header.

No it shouldn't. It has nothing to do with bit manipulation.


reply via email to

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