From: Harlan Stenn Date: Fri, 16 Feb 2007 08:24:28 +0000 (-0500) Subject: ntp_loopfilter.c: X-Git-Tag: NTP_4_2_5P7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eea3ae1c2be4ac6be8815881efafd66ebb10d488;p=thirdparty%2Fntp.git ntp_loopfilter.c: Avoid setting the kernel freq if kernel mode is not disabled in the config file and either the step threshold has been set to 0 or -x has been given. (This is Harlan's interpretation of Dave's comment #14 to bug 778: ) refclock_irig.c: Change the max PLL time constant to 10 (Dave Mills) bk: 45d56a3c7nfnAWTxUQ20kMcY41H91g --- diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 15935fbaa..0d1cf6e36 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -519,7 +519,8 @@ local_clock( } } #if defined(STA_NANO) && NTP_API == 4 - if (pll_control && kern_enable && sys_tai == 0) { + if (pll_control && kern_enable && clock_max > 0 && + sys_tai == 0) { memset(&ntv, 0, sizeof(ntv)); ntv.modes = MOD_TAI; ntv.constant = i + TAI_1972 - 1; @@ -545,8 +546,8 @@ local_clock( * lead to overflow problems. This might occur if some misguided * lad set the step threshold to something ridiculous. */ - if (pll_control && kern_enable && clock_max < 0.5 && - clock_max > 0) { + if (pll_control && kern_enable && clock_max > 0 && + clock_max < .5) { /* * We initialize the structure for the ntp_adjtime() @@ -974,7 +975,7 @@ loop_config( * is zero to cancel any previous nonsense. If you don't * want this initialization, remove the ntp.drift file. */ - if (pll_control && kern_enable) { + if (pll_control && kern_enable && clock_max > 0) { memset((char *)&ntv, 0, sizeof(ntv)); ntv.modes = MOD_FREQUENCY; ntv.freq = (int32)(drift_comp * 65536e6); diff --git a/ntpd/refclock_irig.c b/ntpd/refclock_irig.c index aec811a51..d016407e6 100644 --- a/ntpd/refclock_irig.c +++ b/ntpd/refclock_irig.c @@ -170,7 +170,7 @@ #define SUBFLD 10 /* bits per frame */ #define FIELD 100 /* bits per second */ #define MINTC 2 /* min PLL time constant */ -#define MAXTC 20 /* max PLL time constant max */ +#define MAXTC 10 /* max PLL time constant max */ #define MAXAMP 5000. /* maximum signal amplitude */ #define MINAMP 4000. /* minimum signal amplitude */ #define DRPOUT 100. /* dropout signal amplitude */