ectool: Print temperature unit in ectool temps output

Currently, 'ectool temps all|<n>' just prints "300". This may easily
be mistakenly read as tenth of degree C (30.0 C), as the value
appears to make sense (close to room temperature). However, the value
is actually 300 K (27 C).

CQ-DEPEND=CL:763578
BRANCH=none
BUG=chromium:783845
TEST=ectool temps all shows temperature unit (K)

Change-Id: I70f7f04d061cb1d4f741d59f8b48c7963dd8280f
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/763996
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-11-10 10:05:33 -08:00
committed by chrome-bot
parent 14ef8d73f1
commit bce7b5b4b6

View File

@@ -1624,7 +1624,7 @@ int cmd_temperature(int argc, char *argv[])
id);
break;
default:
printf("%d: %d\n", id,
printf("%d: %d K\n", id,
rv + EC_TEMP_SENSOR_OFFSET);
}
}
@@ -1660,7 +1660,7 @@ int cmd_temperature(int argc, char *argv[])
fprintf(stderr, "Sensor not calibrated\n");
return -1;
default:
printf("%d\n", rv + EC_TEMP_SENSOR_OFFSET);
printf("%d K\n", rv + EC_TEMP_SENSOR_OFFSET);
return 0;
}
}