All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp
Date: Mon, 29 Mar 2010 19:58:40 +0000	[thread overview]
Message-ID: <703813817.3661269892720121.JavaMail.root@mail.savoirfairelinux.com> (raw)
In-Reply-To: <1269639013-26029-1-git-send-email-jerome.oufella@savoirfairelinux.com>

----- "Jonathan Cameron" <jic23@cam.ac.uk> wrote :
> If it works it is fine with me, but please add some documentation so
> that any
> one coming to the code in the future can understand why you aren't
> using
> what the datasheet lists.
> 
> Given it would be useful to provide everything you have listed here,
> I'd
> be inclined to add a file in Documentation/hwmon supported by a
> comment inline
> with the code.  If you have any details on date of manufacture of the
> part you
> tested etc or any comments from the manufacturer it would be useful to
> put
> those in as well.
> 
> Jonathan

Hi Jonathan,

In fact, the new function is doing what the datasheet says,
the function used to interpolate the corresponding value between two
of those reference points being left to the programmer's discretion.

In the current version of sht15_calc_temp(), the interpolation that was
done was being broken because of fixed point divisions that messed
the things up. In fact, the temperatures returned so far were wrong.

So after different tries on trying to improve the current function's 
precision, I ended up getting better results with a different approach
with a proportional factor based linear interpolation.

The manufacturer data remains valid, unchanged, and respected.

Jerome




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2010-03-29 19:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 21:30 [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp Jerome Oufella
2010-03-29 16:23 ` Jerome Oufella
2010-03-29 18:42 ` Jonathan Cameron
2010-03-29 19:58 ` Jerome Oufella [this message]
2010-03-30 11:36 ` Jonathan Cameron
2010-03-30 14:00 ` Jerome Oufella
2010-03-30 14:00 ` Jerome Oufella
2010-04-01 12:01 ` Jean Delvare
2010-04-01 12:01   ` [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp interpolation function Jean Delvare
2010-04-01 12:54 ` [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp Jerome Oufella
2010-04-01 12:54   ` [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp interpolation function Jerome Oufella
2010-04-01 13:49   ` [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp Jonathan Cameron
2010-04-01 13:49     ` [lm-sensors] [PATCH] hwmon: sht15: Fix sht15_calc_temp interpolation function Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 15:02 [lm-sensors] [PATCH] hwmon: (sht15) Fix sht15_calc_temp Jean Delvare

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=703813817.3661269892720121.JavaMail.root@mail.savoirfairelinux.com \
    --to=jerome.oufella@savoirfairelinux.com \
    --cc=lm-sensors@vger.kernel.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 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.