[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Converting string to uint32_t
From: |
Wim Lewis |
Subject: |
Re: [avr-gcc-list] Converting string to uint32_t |
Date: |
Tue, 14 Oct 2014 02:52:08 -0700 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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.
- [avr-gcc-list] Building code, Andreas Höschler, 2014/10/08
- Re: [avr-gcc-list] Building code, Senthil Kumar Selvaraj, 2014/10/09
- Re: [avr-gcc-list] Building code, Andreas Höschler, 2014/10/09
- Re: [avr-gcc-list] Building code, Senthil Kumar Selvaraj, 2014/10/09
- Re: [avr-gcc-list] Building code, Andreas Höschler, 2014/10/09
- [avr-gcc-list] Converting string to uint32_t, Andreas Höschler, 2014/10/13
- Re: [avr-gcc-list] Converting string to uint32_t, Georg-Johann Lay, 2014/10/14
- Re: [avr-gcc-list] Converting string to uint32_t,
Wim Lewis <=
- Re: [avr-gcc-list] Converting string to uint32_t, Andreas Höschler, 2014/10/14