Explicitly set default values for all configurable options.

Make it easier to find out the compiled-in defaults in the code
and set all options in default.cfg.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2012-10-18 13:15:06 +02:00 committed by Richard Cochran
parent 937f3aec5b
commit e3a9535dff
3 changed files with 9 additions and 4 deletions

View File

@ -23,6 +23,7 @@ announceReceiptTimeout 3
# #
# Run time options # Run time options
# #
assume_two_step 0
logging_level 6 logging_level 6
path_trace_enabled 0 path_trace_enabled 0
follow_up_info 0 follow_up_info 0

6
pi.c
View File

@ -32,9 +32,9 @@
#define NSEC_PER_SEC 1000000000 #define NSEC_PER_SEC 1000000000
/* These two take their values from the configuration file. (see ptp4l.c) */ /* These two take their values from the configuration file. (see ptp4l.c) */
double configured_pi_kp; double configured_pi_kp = 0.0;
double configured_pi_ki; double configured_pi_ki = 0.0;
double configured_pi_offset; double configured_pi_offset = 0.0;
struct pi_servo { struct pi_servo {
struct servo servo; struct servo servo;

View File

@ -32,18 +32,21 @@
#include "transport.h" #include "transport.h"
#include "util.h" #include "util.h"
int assume_two_step; int assume_two_step = 0;
static int running = 1; static int running = 1;
static struct config cfg_settings = { static struct config cfg_settings = {
.dds = { .dds = {
.twoStepFlag = TRUE,
.slaveOnly = FALSE, .slaveOnly = FALSE,
.priority1 = 128, .priority1 = 128,
.clockQuality.clockClass = 248, .clockQuality.clockClass = 248,
.clockQuality.clockAccuracy = 0xfe, .clockQuality.clockAccuracy = 0xfe,
.clockQuality.offsetScaledLogVariance = 0xffff, .clockQuality.offsetScaledLogVariance = 0xffff,
.priority2 = 128, .priority2 = 128,
.domainNumber = 0,
.free_running = 0,
.freq_est_interval = 1, .freq_est_interval = 1,
}, },
@ -56,6 +59,7 @@ static struct config cfg_settings = {
.transportSpecific = 0, .transportSpecific = 0,
.path_trace_enabled = 0, .path_trace_enabled = 0,
.follow_up_info = 0, .follow_up_info = 0,
.freq_est_interval = 1,
}, },
.timestamping = TS_HARDWARE, .timestamping = TS_HARDWARE,