Merge branch 'thomab/freq' of ~/gitea/data/gitea-repositories/hramrach/lm-sensors

This commit is contained in:
Michal Suchanek committed 2023-12-24 12:28:52 +01:00
commit c91425c121
3 files changed
+40

No files matched your search

+30
View File
@@ -898,6 +898,33 @@ static void print_chip_curr(const sensors_chip_name *name,
printf("\n");
}
static void print_chip_freq(const sensors_chip_name *name,
const sensors_feature *feature,
int label_size)
{
const sensors_subfeature *sf;
double val;
char *label;
if (!(label = sensors_get_label(name, feature))) {
fprintf(stderr, "ERROR: Can't get label of feature %s!\n",
feature->name);
return;
}
print_label(label, label_size);
free(label);
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_FREQ_INPUT);
if (sf && get_input_value(name, sf, &val) == 0) {
printf("%4.0f %s", val, "MHz");
} else {
printf(" N/A ");
}
printf("\n");
}
static void print_chip_intrusion(const sensors_chip_name *name,
const sensors_feature *feature,
int label_size)
@@ -959,6 +986,9 @@ void print_chip(const sensors_chip_name *name)
case SENSORS_FEATURE_HUMIDITY:
print_chip_humidity(name, feature, label_size);
break;
case SENSORS_FEATURE_FREQ:
print_chip_freq(name, feature, label_size);
break;
case SENSORS_FEATURE_PWM:
print_chip_pwm(name, feature, label_size);
break;