Fix power interval output

Power interval is measured in seconds, not Watt.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6030 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Guenter Roeck committed 2012-03-07 16:12:56 +00:00
1 parent a3e40509e0
commit 107829d11d
2 files changed
+18 -3

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ SVN HEAD
Display both instantaneous and average power if available.
Report thermal sensor type 1 as CPU diode
Align power values better
Fix power interval output
fancontrol: Support setup where one PWM output controls several fans
Output error messages to stderr
sensors-detect: Stop calling for PIIX5 SMBus testers
+17 -3
View File
@@ -586,11 +586,25 @@ static void print_chip_power(const sensors_chip_name *name,
} else
printf(" N/A ");
for (i = 0; i < sensor_count; i++)
scale_value(&sensors[i].value, &sensors[i].unit);
for (i = 0; i < sensor_count; i++) {
/*
* Unit is W and needs to be scaled for all attributes except
* interval, which does not need to be scaled and is reported in
* seconds.
*/
if (strcmp(sensors[i].name, "interval")) {
char *tmpstr;
tmpstr = alloca(4);
scale_value(&sensors[i].value, &unit);
snprintf(tmpstr, 4, "%sW", unit);
sensors[i].unit = tmpstr;
} else {
sensors[i].unit = "s";
}
}
print_limits(sensors, sensor_count, alarms, alarm_count,
label_size, "%s = %6.2f %sW");
label_size, "%s = %6.2f %s");
printf("\n");
}