diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-10 14:32:38 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-11 10:06:54 -0700 |
commit | 0b6b6b7754359546d4fd6684156bc7b120328721 (patch) | |
tree | a4101c6611990f5409a51eb5b04e23a071798aa2 /board | |
parent | 678e649240ed950b08bffa254e994e1f867673d0 (diff) | |
download | chrome-ec-0b6b6b7754359546d4fd6684156bc7b120328721.tar.gz |
Refactor TMP006 module
1) Use floating-point more freely, since it's on all the time now, and
the old fixed-point code no longer compiled.
2) Sensitivity and Bn values are now in a RAM-based struct in
preparation for setting them at runtime. No changes from current
values.
3) If a sensor fails to read good data, is initialized, or loses
power, its die temperature history will be set to the next good
temperature, rather than persisting an arbitrary start value or old
state. This fixes reading wildly inaccurate object temperatures for
the first few seconds following boot/resume.
4) If a sensor loses power, wait for the sensor to report data-ready
before reading temperature/voltage. Otherwise, those read as 0, which
again throws off the first few seconds of data.
BUG=chrome-os-partner:14955
BRANCH=link
TEST=Boot system and set at login screen for a minute to reach thermal
equilibrium. Then reboot system, type 'temps' repeatedly. Data from
TMP006's should initially be Error; after a second or so it should be
good, and shouldn't change more than a few degrees.
Change-Id: Id0b42b9b18e94978ba7d3a1ee33194e44b1904bc
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35188
Diffstat (limited to 'board')
-rw-r--r-- | board/link/board_temp_sensor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/board/link/board_temp_sensor.c b/board/link/board_temp_sensor.c index 14f6f16043..c5b317b204 100644 --- a/board/link/board_temp_sensor.c +++ b/board/link/board_temp_sensor.c @@ -55,8 +55,8 @@ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { const struct tmp006_t tmp006_sensors[TMP006_COUNT] = { /* TODO: Calibrate sensitivity factors. See crosbug.com/p/9599 */ - {"USB C", TEMP_USB_ADDR, 3648}, - {"PCH D", TEMP_PCH_ADDR, 9301}, - {"Hinge C", TEMP_HINGE_ADDR, -11000}, - {"Charger D", TEMP_CHARGER_ADDR, 10426}, + {"USB C", TEMP_USB_ADDR, 3.648 * 1e-14f}, + {"PCH D", TEMP_PCH_ADDR, 9.301 * 1e-14f}, + {"Hinge C", TEMP_HINGE_ADDR, -11.000 * 1e-14f}, + {"Charger D", TEMP_CHARGER_ADDR, 10.426 * 1e-14f}, }; |