avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Extremly confusing behaviour... (more detailed explan


From: Mike Panetta
Subject: Re: [avr-gcc-list] Extremly confusing behaviour... (more detailed explanation of error, believe me its not a volatile thing)
Date: 14 May 2003 13:42:24 -0400

Yeah, I thought that would fix it too.  It does not :(  So far the only
thing that has any reproduceable effect is either print the variable
out, or cast it to int8_t.  It still boggles me as to why I get the
correct value back if I write it to the IO port, but the while is
seemingly ignoring it.

Mike

On Wed, 2003-05-14 at 13:13, E. Weddington wrote:
> On 14 May 2003 at 13:23, Mike Panetta wrote:
> 
> <snip>
> > Now here is the weird part.  If I change the code to this:
> > 
> > do
> > {
> >  delay = 1000;
> >  while (delay--);
> >  PORTA |= _BV (PA1);
> >  retval = srf08_read(1, 0, pingdata, 2);
> >  PORTA &= ~(_BV(PA1));
> >  PORTB = retval;
> >  //printf("%ld ", retval);
> > } while ((int8_t)retval != 2);         <-------------- Change made
> > } here
> > 
> > Then the code works perfectly!!!!
> > 
> 
> What do you get when you do this?:
> 
> } while(retval != 2L);
> 
> Eric




reply via email to

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