Changeset 4827

Show
Ignore:
Timestamp:
09/20/07 23:24:12 (6 years ago)
Author:
khali
Message:

Restore support for beeps.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/chips.c

    r4825 r4827  
    169169                             const sensors_feature_data *feature, int i) 
    170170{ 
    171   const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN; 
    172   short has_features[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = { 0, }; 
    173   int feature_nrs[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN]; 
     171  const int size = SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN; 
     172  short has_features[SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN] = { 0, }; 
     173  int feature_nrs[SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN]; 
    174174  int pos = 0; 
    175175 
     
    203203    voltage->alarmNumber = -1; 
    204204  } 
    205   /* beep support missing for now */ 
    206   voltage->beepNumber = -1; 
     205  /* beep if applicable */ 
     206  if (IN_FEATURE(SENSORS_FEATURE_IN_BEEP)) { 
     207    voltage->beepNumber = IN_FEATURE_NR(SENSORS_FEATURE_IN_ALARM); 
     208  } else { 
     209    voltage->beepNumber = -1; 
     210  } 
    207211} 
    208212 
     
    213217                                 const sensors_feature_data *feature, int i) 
    214218{ 
    215   const int size = SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP; 
    216   short has_features[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP] = { 0, }; 
    217   int feature_nrs[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP]; 
     219  const int size = SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP; 
     220  short has_features[SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP] = { 0, }; 
     221  int feature_nrs[SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP]; 
    218222  int pos = 0; 
    219223 
     
    250254    temperature->alarmNumber = -1; 
    251255  } 
    252   /* beep support missing for now */ 
    253   temperature->beepNumber = -1; 
     256  /* beep if applicable */ 
     257  if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_BEEP)) { 
     258    temperature->beepNumber = TEMP_FEATURE_NR(SENSORS_FEATURE_TEMP_BEEP); 
     259  } else { 
     260    temperature->beepNumber = -1; 
     261  } 
    254262} 
    255263 
     
    260268                         const sensors_feature_data *feature, int i) 
    261269{ 
    262   const int size = SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN; 
    263   short has_features[SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN] = { 0, }; 
    264   int feature_nrs[SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN]; 
     270  const int size = SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN; 
     271  short has_features[SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN] = { 0, }; 
     272  int feature_nrs[SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN]; 
    265273  int pos = 0; 
    266274 
     
    293301    fan->alarmNumber = -1; 
    294302  } 
    295   /* beep support missing for now */ 
    296   fan->beepNumber = -1; 
     303  /* beep if applicable */ 
     304  if (FAN_FEATURE(SENSORS_FEATURE_FAN_BEEP)) { 
     305    fan->beepNumber = FAN_FEATURE_NR(SENSORS_FEATURE_FAN_BEEP); 
     306  } else { 
     307    fan->beepNumber = -1; 
     308  } 
    297309} 
    298310