avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Sleep.h not appropriate for AT94K devices


From: E. Weddington
Subject: Re: [avr-libc-dev] Sleep.h not appropriate for AT94K devices
Date: Tue, 19 Apr 2005 11:06:24 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Wouter van Gulik wrote:

Well the e-mail address that is on almost every file, pdf, CD and eval kit
is:

address@hidden

I suggest you try this one.
Please note that the current cd I have (SystemDesigner 3.0) is dated 2003.
I requested the latest version from my local resaler and I got this version.
So they might be aware of newer version.

Ok, thanks. I'll contact them and see what they say.

Well there is this one thing that really bothers me but it's more a compiler
issue I guess.

If I make a construction like this:

PORTB = 1<< someUnsignedCharVariable;

Then the compiler promotes the "1" to an int and therefore generates some
extra code:
Example:

eor r25, r25
ldi r24, 0x01
add r24, r24
adc r25, r25

But finally it only uses r24, leaving r25 unused.

out PORTB , r24.

I tried various other options but I just don't seem to get the compiler to
handle the 1 as a char.
Shifting with a constant however works fine. (no promotion to an integer)
Any suggestions?

Known issue. This has to do with the C language itself. See the avr-libc user manual, FAQ #20:
<http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_intpromote>

HTH
Eric




reply via email to

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