2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 13:28:01 +00:00

Fix LM90 prints.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1962 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare 2003-08-15 09:23:48 +00:00
parent bb89ea05e3
commit a54d86f8f4

View File

@ -4387,7 +4387,7 @@ void print_lm83(const sensors_chip_name *name)
void print_lm90(const sensors_chip_name *name) void print_lm90(const sensors_chip_name *name)
{ {
char *label; char *label;
double cur, high, low, crit; double cur, high, low;
int valid, alarms; int valid, alarms;
if (!sensors_get_feature(*name, SENSORS_LM90_ALARMS, &cur)) if (!sensors_get_feature(*name, SENSORS_LM90_ALARMS, &cur))
@ -4397,11 +4397,6 @@ void print_lm90(const sensors_chip_name *name)
alarms = 0; 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, if (!sensors_get_label_and_valid(*name, SENSORS_LM90_LOCAL_TEMP,
&label, &valid) &label, &valid)
&& !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TEMP, &cur) && !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"); printf("ERROR: Can't get local temperature data!\n");
free_the_label(&label); 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, if (!sensors_get_label_and_valid(*name, SENSORS_LM90_REMOTE_TEMP,
&label, &valid) &label, &valid)
&& !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TEMP, &cur) && !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"); printf("ERROR: Can't get remote temperature data!\n");
free_the_label(&label); 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, if (!sensors_get_label_and_valid(*name, SENSORS_LM90_TCRIT_HYST,
&label, &valid) &label, &valid)
&& !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &cur)) { && !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &cur)) {
if (valid) { if (valid) {
print_label(label, 10); print_label(label, 10);
print_temp_info(cur, 0, 0, SINGLE, 0, 0); print_temp_info(cur, 0, 0, SINGLE, 0, 0);
printf("\n");
} }
} else } else
printf("ERROR: Can't get hysteresis data!\n"); printf("ERROR: Can't get hysteresis data!\n");