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: E. Weddington
Subject: Re: [avr-gcc-list] Extremly confusing behaviour... (more detailed explanation of error, believe me its not a volatile thing)
Date: Wed, 14 May 2003 11:13:14 -0600

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]