Re: Converting string to uint32_t
Wim Lewis <[email protected]>
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
On 10/13/14 2:57 PM, Andreas Höschler wrote:
> void putLong_in_serial_trans_buffer(uint32_t value)
> {
> char char_buffer[10];
> utoa(value, char_buffer, 10);
The truncation is probably happening here--- utoa() takes an unsigned
int, which is 16 bits on this architecture. Try using ultoa() instead
and see if that helps. Compiling with the -Wconversion option turned on
might warn about this kind of situation.
Wim.