From: Steven Scholz <steven.scholz@imc-berlin.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Bug in DTT for temperatures below zero degress !!!
Date: Wed, 15 Jun 2005 10:50:27 +0200 [thread overview]
Message-ID: <42AFEBD3.3050008@imc-berlin.de> (raw)
Hi there,
there's a terrible bug in the current U-Boot CVS concerning DDT:
For temperature below zero the function dtt_get_temp() (at least for lm75)
returns wrong values!
...
DTT: 1 is 235 C
LCD: Hitachi TX14D11 5,7" 320x240 TFT (235?C)
WDT: disabled
This is because of the use of an "int" although the lm75 only returns two
byte ("signed short").
This trivial fix is needed:
Index: u-boot/dtt/lm75.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/dtt/lm75.c,v
retrieving revision 1.2
diff -u -r1.2 lm75.c
--- u-boot/dtt/lm75.c 27 Jun 2003 21:32:38 -0000 1.2
+++ u-boot/dtt/lm75.c 15 Jun 2005 08:44:21 -0000
@@ -174,7 +170,7 @@
int dtt_get_temp(int sensor)
{
- return (dtt_read(sensor, DTT_READ_TEMP) / 256);
+ return ( ((signed short) dtt_read(sensor, DTT_READ_TEMP)) / 256);
} /* dtt_get_temp() */
#endif /* CONFIG_DTT_LM75 */
Then the output is correct:
...
DTT: 1 is -28 C
LCD: Hitachi TX14D11 5,7" 320x240 TFT (-28?C)
CCFL: disabled (too cold!)
WDT: disabled
I am afraid this is an issues on all DTT in U-Boot. Some even only use "uchar".
Comments?
--
Steven
next reply other threads:[~2005-06-15 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-15 8:50 Steven Scholz [this message]
2006-03-12 14:54 ` [U-Boot-Users] Bug in DTT for temperatures below zero degress !!! Wolfgang Denk
2006-03-14 8:49 ` Steven Scholz
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=42AFEBD3.3050008@imc-berlin.de \
--to=steven.scholz@imc-berlin.de \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.