Actually, I am defining the CPU type here so the compiler will know
which to use (as opposed to it being in the compile command line).
And, as for the "dead" code.  It doesn't matter which Optimization level
I use, the code for the "wait()" function remains in tact and
operational.  I know it's running, because I can see the "pause" in
between LCD changes.  If it were "optimized out" then the display would
change so rapidly, I would only be able to see the "average" lcd
segments.
But thanks for the help.
-Mark


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Pedro
Zorzenon Neto
Sent: Wednesday, November 27, 2002 10:35 AM
To: [email protected]
Subject: Re: [Mspgcc-users] Ok, I have an LCD problem.


Hi Mark,

On Wed, Nov 27, 2002 at 09:31:08AM -0500, Mark Stokes wrote:
> // Define CPU Type
> #define __MSP430_449__

just a hint: don't define __MSP430_xxx__, the compiler already does
that. Check http://mspgcc.sourceforge.net/doc_appendixA.html

> void wait(void)          //delay function
> {
>   volatile int i;        //declare i as volatile int
>   for(i=0;i<32000;i++);  //repeat 32000 times
> }

that is one mistake... mspgcc detects that it is dead-code, and will do
nothing, so it cuts the loop out of your program. Even if declared as
volatile.

check http://mspgcc.sourceforge.net/doc_appendixE.html for delay loop
instructions.


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to