From: Jean-Marc Beaune <jm.beaune@gmail.com>
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] Atmega issue since reinstallation of cross-avr/gcc
Date: Mon, 24 Oct 2011 21:41:42 +0200 [thread overview]
Message-ID: <CAK7bL3ym8MsJ7wbHDC28a03A8Rkui0zbhvVCW6Qa05pAUgMfLQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]
Hi,
Not easy to explain but I'll gi ve a go.
I programed an atmega328p to read temperature and send it via USART. That
worked fine untill I changed my laptop.
After changing my computer (and therefore reinstalling cross-avr/gcc), then
a part of a function used to read the temperature doesn't work anymore, i.e.
it compiles fine but the atmega doesn't send anything via USART, the program
dumps.
I narrowed down the problem and it seems to be a problem when doing some
calculation in a function:
All variables below are declared as uint8_t
The return statement below causes the program to crash:
return (double) temp_LSB - 0.25 + (double)(count_per_c - count_remain) /
count_per_c;
The return statement below causes the program to crash also:
return (double) temp_LSB - 0.25;
The return statement below is OK:
return (double)(count_per_c - count_remain) / count_per_c;
Since it coincides with a change of computer used to compile the program I
wonder if it could be a missing flag/option for cross-avr/gcc?
Any advice appriciated,
Thank you
--
Jean-Marc
[-- Attachment #2: Type: text/html, Size: 1403 bytes --]
reply other threads:[~2011-10-24 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK7bL3ym8MsJ7wbHDC28a03A8Rkui0zbhvVCW6Qa05pAUgMfLQ@mail.gmail.com \
--to=jm.beaune@gmail.com \
--cc=gentoo-embedded@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox