]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_loopfilter.c:
authorHarlan Stenn <stenn@ntp.org>
Fri, 16 Feb 2007 08:24:28 +0000 (03:24 -0500)
committerHarlan Stenn <stenn@ntp.org>
Fri, 16 Feb 2007 08:24:28 +0000 (03:24 -0500)
  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: <https://ntp.isc.org/bugs/show_bug.cgi?id=778#c14>)
refclock_irig.c:
  Change the max PLL time constant to 10 (Dave Mills)

bk: 45d56a3c7nfnAWTxUQ20kMcY41H91g

ntpd/ntp_loopfilter.c
ntpd/refclock_irig.c

index 15935fbaa1afc135def0332adb011a418e06b56b..0d1cf6e36f47767818d6be4c7836b609ea973194 100644 (file)
@@ -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);
index aec811a51e2d114a2d6949ce84ce2069381dc111..d016407e6260b62f31a98a85774e2f0ab04c37ff 100644 (file)
 #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 */