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

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

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


From: E. Weddington
Subject: Re: [avr-gcc-list] Re: What Happened to the sbi() and cbi()
Date: Tue, 01 Feb 2005 06:37:16 -0700
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Pertti Kellomäki wrote:

1. helmi 2005 kello 01:00, Eric wrote:

So far there haven't been too many others complaining about it.


Since you asked,  here's my data point. I am an academic
planning to go small time into embedded systems, and I have
written a data logging application for the AVR Butterfly.
It uses sbi() and cbi() simply because the examples
I based it on used them. If it ain't broke, don't fix it.

I have been through a variety of languages, so I am perfectly
capable of rewriting my code. However, in this case my fix would
be to redefine sbi() and cbi() privately, as I fail to see the inherent
evil in them. Frankly, to set a bit using a construct whose
stated purpose is to set a bit sounds like a good idea to me.

See, that's the problem.

Originally, those macros were written and used to *actually* generate the SBI and CBI instructions. Over time, that functionality was put into the compiler, where it does it automatically if optimization is turned on. So the macros were re-written to just simply set and clear bits. So the big problem is that those macros give a false impression. Hence, deprecated and removed.

Eric

reply via email to

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