diff options
author | Vic Yang <victoryang@chromium.org> | 2012-02-12 00:19:09 +0800 |
---|---|---|
committer | Vic Yang <victoryang@chromium.org> | 2012-02-14 22:30:47 +0800 |
commit | 938649ac67a8bf0440a8b0533f40996c94adf25b (patch) | |
tree | 2dfd9a7242c5e6afe64a2ec4e60538b065fdfb9e /common/temp_sensor.c | |
parent | 12cdccc00ced5c4f48ad1fec6063032547b27337 (diff) | |
download | chrome-ec-938649ac67a8bf0440a8b0533f40996c94adf25b.tar.gz |
Change temperature sensor debug command behaviour
Currently, 'tempsinfo' command would abort when encountering problems
reading temperature sensor info. Change this command to continue reading
succeeding sensors.
Also change 'temps' to show temperature in both 'K' and 'C' for better
reading and easier debugging.
BUG=chrome-os-partner:7527
TEST=none
Change-Id: I41a4068fb58804cb000e6725c0894aabd0104119
Signed-off-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'common/temp_sensor.c')
-rw-r--r-- | common/temp_sensor.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c index 9a0abbdcbc..bc794874ab 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -175,7 +175,7 @@ static int command_temps(int argc, char **argv) rv = -1; } else - uart_printf("%d K\n\n", t); + uart_printf("%d K = %d C\n\n", t, t - 273); } if (rv == -1) @@ -188,19 +188,20 @@ DECLARE_CONSOLE_COMMAND(temps, command_temps); static int command_sensor_info(int argc, char **argv) { int i; - int rv; + int rv, rv1; const struct temp_sensor_t* sensor; + rv1 = EC_SUCCESS; for (i = 0; i < TEMP_SENSOR_COUNT; ++i) { sensor = temp_sensors + i; if (sensor->print == TEMP_SENSOR_NO_PRINT) continue; rv = sensor->print(sensor); if (rv != EC_SUCCESS) - return rv; + rv1 = rv; } - return EC_SUCCESS; + return rv1; } DECLARE_CONSOLE_COMMAND(tempsinfo, command_sensor_info); |