Changeset 5944
- Timestamp:
- 03/16/11 22:31:25 (14 months ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/sensors/chips.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/sensors/chips.c
r5943 r5944 68 68 } 69 69 70 static const char hyst_str[] = "hyst"; 71 70 72 static inline double deg_ctof(double cel) 71 73 { … … 155 157 const char *fmt) 156 158 { 157 int i ;159 int i, slot, skip; 158 160 int alarms_printed = 0; 159 161 160 for (i = 0; i < limit_count; i++) { 161 if (!(i & 1)) { 162 if (i) 162 /* 163 * We print limits on two columns, filling lines first, except for 164 * hysteresis which must always go on the right column, with the 165 * limit it relates to being in the left column on the same line. 166 */ 167 for (i = slot = 0; i < limit_count; i++, slot++) { 168 if (!(slot & 1)) { 169 if (slot) 163 170 printf("\n%*s", label_size + 10, ""); 164 171 printf("("); … … 168 175 printf(fmt, limits[i].name, limits[i].value, 169 176 limits[i].unit); 170 if ((i & 1) || i == limit_count - 1) { 177 178 /* If needed, skip one slot to avoid hyst on first column */ 179 skip = i + 2 < limit_count && limits[i + 2].name == hyst_str && 180 !(slot & 1); 181 182 if (((slot + skip) & 1) || i == limit_count - 1) { 171 183 printf(")"); 172 184 if (alarm_count && !alarms_printed) { 173 185 print_alarms(alarms, alarm_count, 174 ( i& 1) ? 0 : 16);186 (slot & 1) ? 0 : 16); 175 187 alarms_printed = 1; 176 188 } 177 189 } 190 slot += skip; 178 191 } 179 192 if (alarm_count && !alarms_printed) … … 240 253 241 254 static const struct sensor_subfeature_list temp_max_sensors[] = { 242 { SENSORS_SUBFEATURE_TEMP_MAX_HYST, NULL, 0, "hyst"},255 { SENSORS_SUBFEATURE_TEMP_MAX_HYST, NULL, 0, hyst_str }, 243 256 { -1, NULL, 0, NULL } 244 257 }; 245 258 246 259 static const struct sensor_subfeature_list temp_crit_sensors[] = { 247 { SENSORS_SUBFEATURE_TEMP_CRIT_HYST, NULL, 0, "crit hyst"},260 { SENSORS_SUBFEATURE_TEMP_CRIT_HYST, NULL, 0, hyst_str }, 248 261 { -1, NULL, 0, NULL } 249 262 }; … … 251 264 static const struct sensor_subfeature_list temp_emergency_sensors[] = { 252 265 { SENSORS_SUBFEATURE_TEMP_EMERGENCY_HYST, NULL, 0, 253 "emerg hyst"},266 hyst_str }, 254 267 { -1, NULL, 0, NULL } 255 268 };
