|
From: | E. Weddington |
Subject: | Re: [avr-libc-dev] RFC: avr/bits.h |
Date: | Tue, 01 Mar 2005 11:08:44 -0700 |
User-agent: | Mozilla Thunderbird 0.7.3 (Windows/20040803) |
Dave Hylands wrote:
Hi Bob,I wanted to do a test case for using bit_XXX on longs to see if it does the right thing, and wrote the following test case. However the results to me are puzzling, they look down right broken. What is going on here?:Part of the problem is that bit_set wants a bit number, and you're providing a bit mask (I was fooled until I looked at the preprocessor output).
Oh, geez, I didn't see that either. Thanks for catching that Dave.No, no, no. The RFC that I wrote was explicitly for parameters of a value and a *bit mask*, not a bit number.
The use of the bit mask allows one to operate on multiple, non-contiguous bits simultaneously. I would NOT implement macros that operated on a single bit.
Eric
[Prev in Thread] | Current Thread | [Next in Thread] |