[Top][All Lists]

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

Re: [avr-gcc-list] possible compiler bug?

From: Theodore A. Roth
Subject: Re: [avr-gcc-list] possible compiler bug?
Date: Wed, 28 Aug 2002 17:55:28 -0700 (PDT)

On Wed, 28 Aug 2002, Brian Dean wrote:

:) I guess that within 'main()', the compiler "knows" the actual value in
:) the pointer and can take advantage of that knowledge, but within
:) 'set_pwm()', there's no way the compiler can know what value is going
:) to be passed in and must treat it more generically.

The _SFR_* macros can only work on constants. Inside your function, the
compiler can't tell where the params came from since they are passed via
registers. I've been bitten by this too. ;-)

:) I guess I still don't see why _all_ 16 bit writes can't be done high
:) byte first, unless someone knows of a case where, for a 16 bit write,
:) the _low_ byte must be written first for proper operation.  Does
:) anyone have an example from the Atmel datasheets of this "rule" being
:) violated?  I would think that Atmel would be consistant in this as all
:) AVR's share a nearly identical core.

I've yet to see a case where the compiler didn't do the high byte first
for a 16bit register access. I could be wrong though.

Ted Roth

avr-gcc-list at http://avr1.org

reply via email to

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