From e3a9535dff674cac9f8d12d72730d9bdcdfcc081 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 18 Oct 2012 13:15:06 +0200 Subject: [PATCH] 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 --- default.cfg | 1 + pi.c | 6 +++--- ptp4l.c | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/default.cfg b/default.cfg index eeb0b48..9c3bc32 100644 --- a/default.cfg +++ b/default.cfg @@ -23,6 +23,7 @@ announceReceiptTimeout 3 # # Run time options # +assume_two_step 0 logging_level 6 path_trace_enabled 0 follow_up_info 0 diff --git a/pi.c b/pi.c index cf83f9f..b2d1470 100644 --- a/pi.c +++ b/pi.c @@ -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; diff --git a/ptp4l.c b/ptp4l.c index 9a9ba9e..da82774 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -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, }, @@ -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,