avr-gcc-list
[Top][All Lists]
Advanced

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

Fw: [avr-gcc-list] Re: What Happened to the sbi() and cbi() Macros????


From: bethell
Subject: Fw: [avr-gcc-list] Re: What Happened to the sbi() and cbi() Macros????
Date: Wed, 02 Feb 2005 13:07:21 +0500

Hi Srikanth,

The examples thar Eric W. showed are standard C statements.

Perhaps you could get a good text on C (lots cheaply available).

For language extentions pertaining to AVR devices, you could check out
avr-libc documents (assuming you are using avr-gcc!).

Bye,
--Royce.

----- Original Message -----
From: "Panther Alarm & Communication technologies"
<address@hidden>
To: "AVR-GCC" <address@hidden>
Sent: Wednesday, February 02, 2005 12:47 PM
Subject: Re: [avr-gcc-list] Re: What Happened to the sbi() and cbi()
Macros????


Thanks, any other URL to be checked out?

Srikanth Kamath T

On Wed, 02 Feb 2005 00:11:53 -0700, E. Weddington wrote:
> Panther Alarm & Communication technologies wrote:
>
>> Dear Eric,
>>
>> I have it with me already, A solid printed Version, Make a Quick
>> ref
>>
>> Thanks a lot for that and the WinAVR
>>
>> BTW the posting to the list was if you could just give a example
>> out to Newbies
>> Some thing Like Joerg Example of the LED_set
>>
>>
> Here you go:
>
> Checking if a bit is set:
> if (var & bit_mask)
> {
> // The bit defined in the bit_mask is set.
> }
>
> Checking if a bit is clear:
> if (! (var & bit_mask))
> {
> // The bit defined in the bit_mask is clear.
> }
>
> Of course, the above uses the concept of a *bit mask*, not just a *
> bit
> number*.
>
> And next time, please respond to the list and not just to me
> personally.
> Thanks.
> Eric
>
>
>> Bye
>>
>> Srikanth Kamath T
>>
>> On Tue, 01 Feb 2005 23:35:25 -0700, E. Weddington wrote:
>>
>>
>>> Panther Alarm & Communication technologies wrote:
>>>
>>>
>>>> Dear Eric,
>>>>
>>>> ".....AFAIK, bit_is_set, bit_is_clear are both still in. But
>>>> sbi,
>>>> cbi, inb,
>>>> inw, outb, outw, outp, inp are all gone now."
>>>>
>>>> would please inform How to go about the following more
>>>> efficiently in C without using the existing Macros for these,
>>>> and
>>>> a few extra noted will be a added help
>>>>
>>>> 1. bit_is_set()
>>>> 2. bit_is_clear()
>>>>
>>>>
>>> See this primer on bit operations at AVR Freaks:
>>> <http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=876
>>> 4&highlight=programming+101>
>>> Go down to the post that starts with "Programming 101" which
>>> should
>>> be
>>> highlighted.







reply via email to

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