config: convert 'priority1' and 'priority2' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 19:22:05 +02:00
parent ea574c7e4f
commit 0c9d54d3ff
2 changed files with 5 additions and 15 deletions

View File

@ -125,6 +125,8 @@ struct config_item config_tab[] = {
GLOB_ITEM_DBL("pi_proportional_exponent", -0.3, -DBL_MAX, DBL_MAX),
GLOB_ITEM_DBL("pi_proportional_norm_max", 0.7, DBL_MIN, 1.0),
GLOB_ITEM_DBL("pi_proportional_scale", 0.0, 0.0, DBL_MAX),
GLOB_ITEM_INT("priority1", 128, 0, UINT8_MAX),
GLOB_ITEM_INT("priority2", 128, 0, UINT8_MAX),
GLOB_ITEM_INT("sanity_freq_limit", 200000000, 0, INT_MAX),
GLOB_ITEM_INT("slaveOnly", 0, 0, 1),
GLOB_ITEM_DBL("step_threshold", 0.0, 0.0, DBL_MAX),
@ -396,19 +398,7 @@ static enum parser_result parse_global_setting(const char *option,
if (r != NOT_PARSED)
return r;
if (!strcmp(option, "priority1")) {
r = get_ranged_uint(value, &uval, 0, UINT8_MAX);
if (r != PARSED_OK)
return r;
dds->priority1 = uval;
} else if (!strcmp(option, "priority2")) {
r = get_ranged_uint(value, &uval, 0, UINT8_MAX);
if (r != PARSED_OK)
return r;
dds->priority2 = uval;
} else if (!strcmp(option, "domainNumber")) {
if (!strcmp(option, "domainNumber")) {
r = get_ranged_uint(value, &uval, 0, 127);
if (r != PARSED_OK)
return r;

View File

@ -44,11 +44,9 @@ static struct config cfg_settings = {
.dds = {
.dds = {
.priority1 = 128,
.clockQuality.clockClass = 248,
.clockQuality.clockAccuracy = 0xfe,
.clockQuality.offsetScaledLogVariance = 0xffff,
.priority2 = 128,
.domainNumber = 0,
},
.clock_desc = {
@ -232,6 +230,8 @@ int main(int argc, char *argv[])
if (config_get_int(cfg, NULL, "twoStepFlag")) {
ds->flags |= DDS_TWO_STEP_FLAG;
}
ds->priority1 = config_get_int(cfg, NULL, "priority1");
ds->priority2 = config_get_int(cfg, NULL, "priority2");
if (!config_get_int(cfg, NULL, "gmCapable") &&
ds->flags & DDS_SLAVE_ONLY) {