Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Code optimization problem

2005-01-24 by Richard

Robert,   
     I don't follow, the registers are declared thusly:

#define SPI_SPDR   (*((volatile unsigned char *) 0xE0020008))

Richard



--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote:
> At 05:09 PM 1/24/05 +0000, you wrote:
> 
> 
> >I ran into a problem with the Keil compiler and code optimization.
> >The default optimization level was such that lines of code that did
> >dummy reads of registers, this is how some bits are cleared, were
> >optimized out.  Needless to say the code would not work until I
> >lowered the optimization level and thus retained these lines of code.
> >  At least in Keil it is easy to see, when debugging, which lines are
> >executed and which are not.
> 
> 
> Were those registers declared with a void qualifier?  If so than
that is 
> definitely a bug.
> 
> Robert
> 
> " 'Freedom' has no meaning of itself.  There are always restrictions,
> be they legal, genetic, or physical.  If you don't believe me, try to
> chew a radio signal. "
> 
>                          Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.