Changeset 4559
- Timestamp:
- 07/05/07 23:03:06 (6 years ago)
- Location:
- lm-sensors/branches/lm-sensors-3.0.0/prog/sensors
- Files:
-
- 2 modified
-
chips.c (modified) (3 diffs)
-
chips_generic.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips.c
r4543 r4559 23 23 #include <stdlib.h> 24 24 #include <string.h> 25 #include <math.h> 25 26 26 27 #include "chips.h" … … 42 43 int minmax, int curprec, int limitprec) 43 44 { 45 /* note: deg_ctof() will preserve HUGEVAL */ 44 46 if (fahrenheit) { 45 47 n_cur = deg_ctof(n_cur); … … 48 50 } 49 51 50 /* use %* to pass precision as an argument */ 52 /* use %* to pass precision as an argument */ 53 if (n_cur != HUGE_VAL) 54 printf("%+6.*f%s ", curprec, n_cur, degstr); 55 else 56 printf("FAULT "); 57 51 58 if(minmax == MINMAX) 52 printf("%+6.*f%s (low = %+5.*f%s, high = %+5.*f%s) ", 53 curprec, n_cur, degstr, 59 printf("(low = %+5.*f%s, high = %+5.*f%s) ", 54 60 limitprec, n_hyst, degstr, 55 61 limitprec, n_over, degstr); 56 62 else if(minmax == MAXONLY) 57 printf("%+6.*f%s (high = %+5.*f%s) ", 58 curprec, n_cur, degstr, 63 printf("(high = %+5.*f%s) ", 59 64 limitprec, n_over, degstr); 60 65 else if(minmax == CRIT) 61 printf("%+6.*f%s (high = %+5.*f%s, crit = %+5.*f%s) ", 62 curprec, n_cur, degstr, 66 printf("(high = %+5.*f%s, crit = %+5.*f%s) ", 63 67 limitprec, n_over, degstr, 64 68 limitprec, n_hyst, degstr); 65 69 else if(minmax == HYST) 66 printf("%+6.*f%s (high = %+5.*f%s, hyst = %+5.*f%s) ", 67 curprec, n_cur, degstr, 70 printf("(high = %+5.*f%s, hyst = %+5.*f%s) ", 68 71 limitprec, n_over, degstr, 69 72 limitprec, n_hyst, degstr); 70 else if(minmax == SINGLE)71 printf("%+6.*f%s",72 curprec, n_cur, degstr);73 73 else if(minmax == HYSTONLY) 74 printf("%+6.*f%s (hyst = %+5.*f%s) ", 75 curprec, n_cur, degstr, 74 printf("(hyst = %+5.*f%s) ", 76 75 limitprec, n_over, degstr); 77 else 76 else if(minmax != SINGLE) 78 77 printf("Unknown temperature mode!"); 79 78 } -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips_generic.c
r4556 r4559 22 22 #include <stdlib.h> 23 23 #include <string.h> 24 #include <math.h> 24 25 25 26 #include "chips_generic.h" … … 152 153 } 153 154 155 if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_FAULT) && 156 TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_FAULT)) 157 val = HUGE_VAL; 158 154 159 print_label(label, label_size); 155 160 free(label); … … 170 175 } 171 176 172 /* ALARM and FAULT features */ 173 if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_FAULT) && 174 TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_FAULT) > 0.5) { 175 printf(" FAULT"); 176 } else 177 /* ALARM features */ 177 178 if ((TEMP_FEATURE(SENSORS_FEATURE_TEMP_ALARM) && 178 179 TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_ALARM) > 0.5) … … 315 316 print_label(label, label_size); 316 317 free(label); 317 printf("%4.0f RPM", val); 318 319 if (FAN_FEATURE(SENSORS_FEATURE_FAN_FAULT) && 320 FAN_FEATURE_VAL(SENSORS_FEATURE_FAN_FAULT)) 321 printf("FAULT "); 322 else 323 printf("%4.0f RPM", val); 318 324 319 325 sensors_get_available_features(name, feature, i, j, has_features, feature_vals, … … 330 336 printf(" (div = %1.0f)", FAN_FEATURE_VAL(SENSORS_FEATURE_FAN_DIV)); 331 337 332 /* ALARM and FAULT features */333 if (FAN_FEATURE(SENSORS_FEATURE_FAN_FAULT) &&334 FAN_FEATURE_VAL(SENSORS_FEATURE_FAN_FAULT)) {335 printf(" FAULT");336 } else337 338 if (FAN_FEATURE(SENSORS_FEATURE_FAN_ALARM) && 338 339 FAN_FEATURE_VAL(SENSORS_FEATURE_FAN_ALARM)) {
