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 detailedexplana


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

Actually its returning an int32_t.  Here is the function declaration for
your refrence:

int32_t srf08_read(uint8_t address, uint8_t reg, uint8_t *data, int32_t
len);

I guess you could say thats a string of bytes, but I would expect the
compiler to treat an int32_t as a 32bit quantity when I am using it in a
comparison...  The LSB of the value is definately correct (I am writing
it to PORTB), and in srf08_read I have a printf just before it returns
that prints the value.  It prints what I expect it to.

Mike


On Wed, 2003-05-14 at 13:13, Larry Barello wrote:
> Well, clearly srf08_read() is NOT returning 2 when reading the data!  It is 
> returning a
> series of bytes of which only ONE is the true return value.
> 
> Casting the return value to an byte clips off the higher bytes (which are 
> bogus anyway,
> right?)
> 




reply via email to

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