mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-02 15:25:38 +00:00
Added 'beep' file for GL518SM chips
This file consists of two numbers: the first is either 0 (global sound alarm disable) or 1 (enable), the second is in the same encoding as the 'alarm' file and determines for which alarms the speaker will sound. The new file was added to the module, the library and the sensors application. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@112 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -222,7 +222,7 @@ void print_gl518(const sensors_chip_name *name)
|
||||
{
|
||||
char *label = NULL;
|
||||
double cur,min,max,fdiv;
|
||||
int alarms;
|
||||
int alarms,beeps;
|
||||
int is_r00;
|
||||
|
||||
is_r00 = !strcmp(name->prefix,"gl518sm-r00");
|
||||
@@ -232,57 +232,67 @@ void print_gl518(const sensors_chip_name *name)
|
||||
printf("ERROR: Can't get alarm data!\n");
|
||||
alarms = 0;
|
||||
}
|
||||
if (!sensors_get_feature(*name,SENSORS_GL518R00_BEEPS,&cur))
|
||||
beeps = cur + 0.5;
|
||||
else {
|
||||
printf("ERROR: Can't get beep data!\n");
|
||||
beeps = 0;
|
||||
}
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VDD,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VDD?"ALARM":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VDD data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
/* We need special treatment for the R00 chips, because they can't display
|
||||
actual readings! We hardcode this, as this is the easiest way. */
|
||||
if (is_r00) {
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VDD,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VDD?"ALARM":"",
|
||||
beeps&GL518_ALARM_VDD?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VDD data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN1,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN1?"ALARM":"");
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN1?"ALARM":"",
|
||||
beeps&GL518_ALARM_VIN1?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VIN1 data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN2,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN2?"ALARM":"");
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN2?"ALARM":"",
|
||||
beeps&GL518_ALARM_VIN2?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VIN2 data!\n");
|
||||
free_the_label(&label);
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN3,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN3?"ALARM":"");
|
||||
} else
|
||||
printf("ERROR: Can't get IN3 data!\n");
|
||||
printf("ERROR: Can't get IN2 data!\n");
|
||||
free_the_label(&label);
|
||||
} else {
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VDD,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VDD?"ALARM":"",
|
||||
beeps&GL518_ALARM_VDD?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VDD data!\n");
|
||||
free_the_label(&label);
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN1,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN1?"ALARM":"");
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN1?"ALARM":"",
|
||||
beeps&GL518_ALARM_VIN1?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VIN1 data!\n");
|
||||
free_the_label(&label);
|
||||
@@ -291,30 +301,35 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN2?"ALARM":"");
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN2?"ALARM":"",
|
||||
beeps&GL518_ALARM_VIN2?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get VIN2 data!\n");
|
||||
free_the_label(&label);
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN3,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN3?"ALARM":"");
|
||||
} else
|
||||
printf("ERROR: Can't get IN3 data!\n");
|
||||
printf("ERROR: Can't get IN2 data!\n");
|
||||
free_the_label(&label);
|
||||
}
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_VIN3,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
cur,min,max,alarms&GL518_ALARM_VIN3?"ALARM":"",
|
||||
beeps&GL518_ALARM_VIN3?"(beep)":"");
|
||||
|
||||
} else
|
||||
printf("ERROR: Can't get VIN3 data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_FAN1,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_FAN1,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_FAN1_DIV,&fdiv) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_FAN1_MIN,&min)) {
|
||||
print_label(label,10);
|
||||
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n",
|
||||
cur,min,fdiv, alarms&GL518_ALARM_FAN1?"ALARM":"");
|
||||
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s %s\n",
|
||||
cur,min,fdiv, alarms&GL518_ALARM_FAN1?"ALARM":"",
|
||||
beeps&GL518_ALARM_FAN1?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get FAN1 data!\n");
|
||||
free_the_label(&label);
|
||||
@@ -323,8 +338,9 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_FAN2_DIV,&fdiv) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_FAN2_MIN,&min)) {
|
||||
print_label(label,10);
|
||||
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n",
|
||||
cur,min,fdiv, alarms&GL518_ALARM_FAN2?"ALARM":"");
|
||||
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s %s\n",
|
||||
cur,min,fdiv, alarms&GL518_ALARM_FAN2?"ALARM":"",
|
||||
beeps&GL518_ALARM_FAN2?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get FAN2 data!\n");
|
||||
free_the_label(&label);
|
||||
@@ -334,11 +350,23 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_HYST,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_OVER,&max)) {
|
||||
print_label(label,10);
|
||||
printf("%+3.0f C (limit = %+3.0f C, hysteris = %+3.0f C) %s\n",
|
||||
cur,max,min, alarms&GL518_ALARM_TEMP?"ALARM":"");
|
||||
printf("%+3.0f C (limit = %+3.0f C, hysteris = %+3.0f C) %s %s\n",
|
||||
cur,max,min, alarms&GL518_ALARM_TEMP?"ALARM":"",
|
||||
beeps&GL518_ALARM_TEMP?"(beep)":"");
|
||||
} else
|
||||
printf("ERROR: Can't get TEMP data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_BEEP_ENABLE,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_BEEP_ENABLE,&cur)) {
|
||||
print_label(label,10);
|
||||
if (cur < 0.5)
|
||||
printf("Sound alarm disabled\n");
|
||||
else
|
||||
printf("Sound alarm enabled\n");
|
||||
} else
|
||||
printf("ERROR: Can't get BEEP data!\n");
|
||||
free_the_label(&label);
|
||||
}
|
||||
|
||||
void print_unknown_chip(const sensors_chip_name *name)
|
||||
|
Reference in New Issue
Block a user