- Introduce a define for ZERO_C_TO_K.

- Fix the printing of the temperature when we exceed the critical value.

Approved by:	nwhitehorn (mentor)
This commit is contained in:
Andreas Tobler 2011-06-03 20:43:12 +00:00
parent aa7e99afbd
commit 7736fb1874
2 changed files with 6 additions and 3 deletions

View File

@ -109,9 +109,10 @@ pmac_therm_manage_fans(void)
printf("WARNING: Current temperature (%s: %d.%d C) "
"exceeds critical temperature (%d.%d C)! "
"Shutting down!\n", sensor->sensor->name,
sensor->last_val / 10, sensor->last_val % 10,
sensor->sensor->max_temp / 10,
sensor->sensor->max_temp % 10);
(sensor->last_val - ZERO_C_TO_K) / 10,
(sensor->last_val - ZERO_C_TO_K) % 10,
(sensor->sensor->max_temp - ZERO_C_TO_K) / 10,
(sensor->sensor->max_temp - ZERO_C_TO_K) % 10);
shutdown_nice(RB_POWEROFF);
}
}

View File

@ -29,6 +29,8 @@
#ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H
#define _POWERPC_POWERMAC_POWERMAC_THERMAL_H
#define ZERO_C_TO_K 2732
struct pmac_fan {
int min_rpm, max_rpm, default_rpm;