From a54d86f8f41de9aa5d5774d627a8a110543923f9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 15 Aug 2003 09:23:48 +0000 Subject: [PATCH] Fix LM90 prints. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1962 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/sensors/chips.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 175e6de6..7215f918 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -4387,7 +4387,7 @@ void print_lm83(const sensors_chip_name *name) void print_lm90(const sensors_chip_name *name) { char *label; - double cur, high, low, crit; + double cur, high, low; int valid, alarms; if (!sensors_get_feature(*name, SENSORS_LM90_ALARMS, &cur)) @@ -4397,11 +4397,6 @@ void print_lm90(const sensors_chip_name *name) alarms = 0; } - if (sensors_get_feature(*name, SENSORS_LM90_LOCAL_TCRIT, &crit)) { - printf("ERROR: Can't get local tcrit data!\n"); - crit = 127; - } - if (!sensors_get_label_and_valid(*name, SENSORS_LM90_LOCAL_TEMP, &label, &valid) && !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TEMP, &cur) @@ -4418,11 +4413,6 @@ void print_lm90(const sensors_chip_name *name) printf("ERROR: Can't get local temperature data!\n"); free_the_label(&label); - if (sensors_get_feature(*name, SENSORS_LM90_REMOTE_TCRIT, &crit)) { - printf("ERROR: Can't get remote tcrit data!\n"); - crit = 127; - } - if (!sensors_get_label_and_valid(*name, SENSORS_LM90_REMOTE_TEMP, &label, &valid) && !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TEMP, &cur) @@ -4440,12 +4430,37 @@ void print_lm90(const sensors_chip_name *name) printf("ERROR: Can't get remote temperature data!\n"); free_the_label(&label); + if (!sensors_get_label_and_valid(*name, SENSORS_LM90_LOCAL_TCRIT, + &label, &valid) + && !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TCRIT, &cur)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get local tcrit data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_LM90_REMOTE_TCRIT, + &label, &valid) + && !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TCRIT, &cur)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get remote tcrit data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name, SENSORS_LM90_TCRIT_HYST, &label, &valid) && !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &cur)) { if (valid) { print_label(label, 10); print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); } } else printf("ERROR: Can't get hysteresis data!\n");