[Top][All Lists]

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

Re: [avr-gcc-list] Extremly confusing behaviour...

From: Keith Gudger
Subject: Re: [avr-gcc-list] Extremly confusing behaviour...
Date: Tue, 13 May 2003 13:36:59 -0700 (PDT)

Have you looked at FAQ #1?  I think that "volatile" might solve your

On 13 May 2003, Mike Panetta wrote:

> I am trying to get some code to work that interfaces with some sonar
> modules, and I have run into a real odd problem.  If I write the code
> that accesses the sensors in a streight line (IE not in a for loop)
> the code just above it that polls one of the sensors to see if they are
> ready works.  If I write the sensor reading code in a for loop, it does
> not work at all.  The code that fails is not being changed by me in any
> way (I have no clue what the compiler may or may not be doing to it
> however) so I do not understand why in one case its failing, and in
> another it works fine.  I do not know if its a compiler bug, or maybe I
> am just stupidly overlooking something in my own code...  The code is
> attached, the exact bit of code I am referring to is between the #if 1,
> #else, and #endif compiler directives.  To sum it up, if I change the
> #if 1 to an #if 0 (to enable the inline code and disable the looped
> code) the code works fine.  If I leave it as #if 1 (to use the looped
> code) I never get to the 'printf("Gathering ping data from sensors.\n")'
> line.
> Thanks for any help,
> Mike

reply via email to

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