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

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

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


From: Royce & Sharal Pereira
Subject: Re: [avr-gcc-list] What Happened to the sbi() and cbi() Macros????
Date: Sun, 30 Jan 2005 20:49:05 +0530

Hi,
----- Original Message -----
From: "Erik Walthinsen" <address@hidden>
To: "E. Weddington" <address@hidden>; <address@hidden>
Sent: Sunday, January 30, 2005 8:18 AM
Subject: Re: [avr-gcc-list] avr-gcc/avr-binutils/avr-libc and the
ATMega168 -what am I doing wrong, tnx!


> E. Weddington wrote:
> > They've been deprecated for a long time. They were finally removed in
> > the 1.2.x series. They're gone for good.
>
> I still have not figured out what the logic is behind removing two of
> the most useful macros possible on a machine where ALL IO is preformed
> by setting and clearing bits.
>
> Please, enlighten me.
>

I'm at a very junior level in this discussion, but I feel these macros
should never have existed.
|= and &= have always been the standard way. This way one does not have to
remember so many macros.

Also, I see the compiler is smart enough to optimise this statement, to
produce different code for SFRs and RAM.
Probably this was not so in the past, which prompted creation these macros.

Of course, one can always create any number of customised macros for oneself
if need be.

Ned Konz has posted on this list a way to access SFRs as bits, nibbles,
bytes. This is a really elegant way instead of  _BV(), cbi(), etc. Why cant
this be made the standard way to access SFR bits? This is a far intuitive
way than the new macros bit_toggle() etc suggested by Erik Weddington.

Thanks,
--Royce.




reply via email to

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