2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

long promised print_generic_chip_in() fixes

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4514 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Hans de Goede
2007-06-28 21:00:08 +00:00
parent e08eabe33c
commit 184ad7e23e

View File

@@ -251,30 +251,35 @@ static void print_generic_chip_in(const sensors_chip_name *name,
free(label);
printf("%+6.2f V", val);
if (IN_FEATURE(SENSORS_FEATURE_IN_MIN))
printf(" (min = %+6.2f V", IN_FEATURE_VAL(SENSORS_FEATURE_IN_MIN));
if (IN_FEATURE(SENSORS_FEATURE_IN_MAX)) {
printf(" (min = %+6.2f V, max = %+6.2f V)",
IN_FEATURE_VAL(SENSORS_FEATURE_IN_MIN),
IN_FEATURE_VAL(SENSORS_FEATURE_IN_MAX));
if (IN_FEATURE(SENSORS_FEATURE_IN_MIN))
printf(", ");
else
printf(" (");
printf("max = %+6.2f V)", IN_FEATURE_VAL(SENSORS_FEATURE_IN_MAX));
}
if (IN_FEATURE(SENSORS_FEATURE_IN_MAX_ALARM) ||
IN_FEATURE(SENSORS_FEATURE_IN_MIN_ALARM)) {
alarm_max = IN_FEATURE_VAL(SENSORS_FEATURE_IN_MAX_ALARM);
alarm_min = IN_FEATURE_VAL(SENSORS_FEATURE_IN_MIN_ALARM);
if (IN_FEATURE(SENSORS_FEATURE_IN_MAX_ALARM) &&
IN_FEATURE(SENSORS_FEATURE_IN_MIN_ALARM)) {
alarm_max = IN_FEATURE_VAL(SENSORS_FEATURE_IN_MAX_ALARM);
alarm_min = IN_FEATURE_VAL(SENSORS_FEATURE_IN_MIN_ALARM);
if (alarm_min || alarm_max) {
printf(" ALARM (");
if (alarm_min || alarm_max) {
printf(" ALARM (");
if (alarm_min)
printf("MIN");
if (alarm_max)
printf("%sMAX", (alarm_min) ? "," : "");
printf(")");
}
} else if (IN_FEATURE(SENSORS_FEATURE_IN_ALARM)) {
printf(" %s",
IN_FEATURE_VAL(SENSORS_FEATURE_IN_ALARM) > 0.5 ? "ALARM" : "");
if (alarm_min)
printf("MIN");
if (alarm_max)
printf("%sMAX", (alarm_min) ? ", " : "");
printf(")");
}
} else if (IN_FEATURE(SENSORS_FEATURE_IN_ALARM)) {
printf(" %s",
IN_FEATURE_VAL(SENSORS_FEATURE_IN_ALARM) ? "ALARM" : "");
}
printf("\n");