]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, refclock_wwv.c:
authorHarlan Stenn <stenn@ntp.org>
Tue, 11 Jan 2000 04:33:04 +0000 (04:33 -0000)
committerHarlan Stenn <stenn@ntp.org>
Tue, 11 Jan 2000 04:33:04 +0000 (04:33 -0000)
  * ntpd/refclock_wwv.c: Bugfixes/improvements
  From: Dave Mills <mills@udel.edu>

bk: 387ab280iiPw1MBt-lU6omcLoOcEoA

ChangeLog
ntpd/refclock_wwv.c

index 072509dbe5ae53a61b75b1bc5b4768a9390ec0b1..6de8ae8e0f918c5e6e5e473281bb37b2455c4b1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-01-10  Harlan Stenn  <stenn@whimsy.udel.edu>
 
+       * ntpd/refclock_wwv.c: Bugfixes/improvements
+       From: Dave Mills <mills@udel.edu>
+
        * configure.in: Get the quoting right on the sys_errlist check.
        From documentation by: Akim Demaille <akim@epita.fr>
 
index 3448a5029d6d969d0a3c8832cffd6d21f881749d..da831a308db737e4bfbb39c08b6cb855073438ad 100644 (file)
@@ -1223,11 +1223,10 @@ wwv_rf(
                         * lamp and raises an alarm.
                         */
                        up->swatch++;
-                       if (up->swatch > HSPEC) {
+                       if (up->swatch > HSPEC)
                                up->status &= ~SSYNC;
+                       if (!(up->status & SSYNC))
                                up->alarm |= 1 << SYNERR;
-                               up->swatch = 0;
-                       }
                }
        }
 
@@ -1623,9 +1622,14 @@ wwv_endpoc(
         * candidate is identical to the last one; otherwise, it is
         * forced to zero. If the compare counter increments to 10, the
         * epoch is reset and the receiver second epoch is set.
+        *
+        * Careful attention to detail here. If the signal amplitude
+        * falls below the threshold or if no stations are heard, we
+        * certainly cannot be in sync.
         */
        tmp2 = MOD(tepoch - xepoch, SECOND);
-       if (up->epomax < STHR) {
+       if (up->epomax < STHR || !(up->status & (SELV | SELH))) {
+               up->status &= ~SSYNC;
                jitcnt = syncnt = avgcnt = 0;
        } else if (abs(tmp2) <= MS || jitcnt >= (MINAVG << up->avgint))
            {