diff options
Diffstat (limited to 'common/temp_sensor.c')
-rw-r--r-- | common/temp_sensor.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c index 799f4f609e..7f5a5e7a53 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -139,11 +139,22 @@ static int command_temps(int argc, char **argv) for (i = 0; i < TEMP_SENSOR_COUNT; ++i) { ccprintf(" %-20s: ", temp_sensors[i].name); rv = temp_sensor_read(i, &t); - if (rv) { - ccprintf("Error %d\n", rv); + if (rv) rv1 = rv; - } else + + switch (rv) { + case EC_SUCCESS: ccprintf("%d K = %d C\n", t, t - 273); + break; + case EC_ERROR_NOT_POWERED: + ccprintf("Not powered\n"); + break; + case EC_ERROR_NOT_CALIBRATED: + ccprintf("Not calibrated\n"); + break; + default: + ccprintf("Error %d\n", rv); + } } return rv1; |