summaryrefslogtreecommitdiff
path: root/common/temp_sensor.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-07-31 13:08:11 -0700
committerChromeBot <chrome-bot@google.com>2013-08-07 17:24:09 -0700
commit6f8e276cc842d0804292d473fe3305295d2e7052 (patch)
tree3b66c44e86db4b8f2ebbc157666e6ed62f6e3ff1 /common/temp_sensor.c
parente98bde3fec5e53314a15fd031c83ee630973483f (diff)
downloadchrome-ec-6f8e276cc842d0804292d473fe3305295d2e7052.tar.gz
Use macros for C <-> K conversions
This just replaces all the "X - 273", "Y + 273" stuff with a macro. BUG=none BRANCH=falco,peppy TEST=manual Run the EC console command "temps". It should print human-readable things. Change-Id: Icc4284c89fdbc0cd3b206a0faacf121973652a63 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65005 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/temp_sensor.c')
-rw-r--r--common/temp_sensor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index e33d787b9c..9b8fbe32fb 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -119,7 +119,7 @@ static int command_temps(int argc, char **argv)
switch (rv) {
case EC_SUCCESS:
- ccprintf("%d K = %d C\n", t, t - 273);
+ ccprintf("%d K = %d C\n", t, K_TO_C(t));
break;
case EC_ERROR_NOT_POWERED:
ccprintf("Not powered\n");