Re: [PATCH] hwmon: sht15: Fix sht15_calc_temp interpolation function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- "Jonathan Cameron" <jic23@xxxxxxxxx> 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@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux