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

Changed alarms proc entry to a single value

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1449 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Abraham van der Merwe
2002-07-12 08:50:44 +00:00
parent 6b65a1d7b3
commit a52803cdc5
3 changed files with 22 additions and 37 deletions

View File

@@ -2822,9 +2822,7 @@ static sensors_chip_feature lm92_features[] =
LM92_TEMP (SENSORS_LM92_TEMP_LOW,"temp_low",SENSORS_LM92_TEMP,SENSORS_MODE_RW,3),
LM92_TEMP (SENSORS_LM92_TEMP_CRIT,"temp_crit",SENSORS_LM92_TEMP,SENSORS_MODE_RW,4),
LM92_TEMP (SENSORS_LM92_TEMP_HYST,"temp_hyst",SENSORS_LM92_TEMP,SENSORS_MODE_RW,5),
LM92_ALARM (SENSORS_LM92_ALARMS_HIGH,"alarms_high",SENSORS_NO_MAPPING,1),
LM92_ALARM (SENSORS_LM92_ALARMS_LOW,"alarms_low",SENSORS_LM92_ALARMS_HIGH,2),
LM92_ALARM (SENSORS_LM92_ALARMS_CRIT,"alarms_crit",SENSORS_LM92_ALARMS_CRIT,3)
LM92_ALARM (SENSORS_LM92_ALARMS,"alarms",SENSORS_NO_MAPPING,1),
};
sensors_chip_features sensors_chip_features_list[] =

View File

@@ -1202,8 +1202,6 @@
#define SENSORS_LM92_TEMP_CRIT 3 /* RW */
#define SENSORS_LM92_TEMP_HYST 4 /* RW */
#define SENSORS_LM92_TEMP 5 /* R */
#define SENSORS_LM92_ALARMS_HIGH 6 /* R */
#define SENSORS_LM92_ALARMS_LOW 7 /* R */
#define SENSORS_LM92_ALARMS_CRIT 8 /* R */
#define SENSORS_LM92_ALARMS 6 /* R */
#endif /* def LIB_SENSORS_CHIPS_H */

View File

@@ -3334,18 +3334,14 @@ static void lm92_print_temp (float n_cur,float n_high,float n_low,float n_crit,f
void print_lm92 (const sensors_chip_name *name)
{
char *label = NULL;
double temp[5],alarms[3];
int valid,comma = 0;
double temp[5];
int valid;
if (fahrenheit) {
sprintf (degv,"%cF",176);
n
if (!sensors_get_feature (*name,SENSORS_LM92_ALARMS_HIGH,alarms) &&
!sensors_get_feature (*name,SENSORS_LM92_ALARMS_LOW,alarms + 1) &&
!sensors_get_feature (*name,SENSORS_LM92_ALAMRS_CRIT,alarms + 2)) {
alarms[0] = (int) (alarms[0] + 0.5);
alarms[1] = (int) (alarms[1] + 0.5);
alarms[2] = (int) (alarms[2] + 0.5);
if (!sensors_get_feature (*name,SENSORS_LM92_ALARMS,temp)) {
alarms = *temp + 0.5;
} else {
printf ("ERROR: Can't get alarm data!\n");
return;
@@ -3360,24 +3356,17 @@ void print_lm92 (const sensors_chip_name *name)
if (valid) {
print_label (label,10);
print_temp_info (temp[0],temp[1],temp[2],temp[3],temp[4]);
if (alarms[0] || alarms[1] || alarms[2]) {
if (alarms) {
printf (" ALARMS (");
if (alarms[0]) {
comma = 1;
if ((alarms & LM92_ALARM_TEMP_HIGH))
printf ("HIGH");
}
if (alarms[1]) {
if (comma) printf (",");
comma = 1;
printf ("LOW");
}
if (alarms & LM92_ALARM_TEMP_LOW)
printf ("%sLOW",(alarms & LM92_ALARM_TEMP_HIGH) ? "," : "");
if (alarms[2]) {
if (comma) printf (",");
printf ("CRIT");
}
if (alarms & LM92_ALARM_TEMP_CRIT)
printf ("%sCRIT",(alarms & (LM92_ALARM_TEMP_HIGH | LM92_ALARM_TEMP_LOW)) ? "," : "");
printf (")");
}