Skip to content

Commit

Permalink
Explicitly set default values for all configurable options.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mlichvar authored and richardcochran committed Oct 18, 2012
1 parent 937f3ae commit e3a9535
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ announceReceiptTimeout 3
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
Expand Down
6 changes: 3 additions & 3 deletions pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#define NSEC_PER_SEC 1000000000

/* These two take their values from the configuration file. (see ptp4l.c) */
double configured_pi_kp;
double configured_pi_ki;
double configured_pi_offset;
double configured_pi_kp = 0.0;
double configured_pi_ki = 0.0;
double configured_pi_offset = 0.0;

struct pi_servo {
struct servo servo;
Expand Down
6 changes: 5 additions & 1 deletion ptp4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@
#include "transport.h"
#include "util.h"

int assume_two_step;
int assume_two_step = 0;

static int running = 1;

static struct config cfg_settings = {
.dds = {
.twoStepFlag = TRUE,
.slaveOnly = FALSE,
.priority1 = 128,
.clockQuality.clockClass = 248,
.clockQuality.clockAccuracy = 0xfe,
.clockQuality.offsetScaledLogVariance = 0xffff,
.priority2 = 128,
.domainNumber = 0,
.free_running = 0,
.freq_est_interval = 1,
},

Expand All @@ -56,6 +59,7 @@ static struct config cfg_settings = {
.transportSpecific = 0,
.path_trace_enabled = 0,
.follow_up_info = 0,
.freq_est_interval = 1,
},

.timestamping = TS_HARDWARE,
Expand Down

0 comments on commit e3a9535

Please sign in to comment.