]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Typo fixes from Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
authorHarlan Stenn <stenn@ntp.org>
Sun, 30 Mar 2003 21:51:05 +0000 (16:51 -0500)
committerHarlan Stenn <stenn@ntp.org>
Sun, 30 Mar 2003 21:51:05 +0000 (16:51 -0500)
bk: 3e8766c9MN_M9aHvLjEIBwkoBirDrg

html/mx4200data.html
ntpd/refclock_chu.c
ntpd/refclock_mx4200.c
ntpd/refclock_ripencc.c
parseutil/dcfd.c
parseutil/testdcf.c

index ec7dcfc3980ba2802cfb43a4c89526153fa15564..c2ab03a2d9796d28b42a8a690fe9f5c5990404d2 100644 (file)
             </tr>
             <tr>
                 <td>11</td>
-                <td>Leap Second Flag - indicates that a leap second will occur. This value is usually zero except during the week prior to a leap second occurence, when this value will be set to +/-1. A value of +1 indicates that GPS time will be 1 second further ahead of UTC time.</td>
+                <td>Leap Second Flag - indicates that a leap second will occur. This value is usually zero except during the week prior to a leap second occurrence, when this value will be set to +/-1. A value of +1 indicates that GPS time will be 1 second further ahead of UTC time.</td>
                 <td>&nbsp;</td>
                 <td>Int</td>
                 <td>-1,0,1</td>
index 4c69c2fa2ce4ebd55d28f19281f316f8779cf3e0..2344e2678db55370d96587cd8584fb93d5d53569 100644 (file)
@@ -40,7 +40,7 @@
  * change throughout the day and night.
  *
  * The driver receives, demodulates and decodes the radio signals when
- * connected to the audio codec of supported workstation hardware and
+ * connected to the audio codec of a suported workstation hardware and
  * operating system. These include Solaris, SunOS, FreeBSD, NetBSD and
  * Linux. In this implementation, only one audio driver and codec can be
  * supported on a single machine.
 #define TUNE           .001    /* offset for narrow filter (kHz) */
 #define DWELL          5       /* minutes in a probe cycle */
 #define NCHAN          3       /* number of channels */
-#undef  NSTAGE
-#define NSTAGE         3       /* number of integrator stages */
+#define ISTAGE         3       /* number of integrator stages */
 #endif /* ICOM */
 
 #ifdef HAVE_AUDIO
 #define MINSYNC                8       /* min sync distance (of 16) */
 #define MINSTAMP       20      /* min timestamps (of 60) */
 #define METRIC         50.     /* min channel metric */
-#define PANIC          (4 * 1440) /* panic restart */
+#define PANIC          1440    /* panic timeout (m) */
+#define HOLD           30      /* reach hold (m) */
 
 /*
  * Hex extension codes (>= 16)
@@ -290,7 +290,7 @@ struct surv {
  * three frequencies.
  */
 struct xmtr {
-       double  integ[NSTAGE];  /* circular integrator */
+       double  integ[ISTAGE];  /* circular integrator */
        double  metric;         /* integrator sum */
        int     iptr;           /* integrator pointer */
        int     probe;          /* dwells since last probe */
@@ -1256,8 +1256,9 @@ chu_poll(
 {
        struct refclockproc *pp;
        struct chuunit *up;
+       l_fp    offset;
        char    synchar, qual, leapchar;
-       int     minset;
+       int     minset, i;
        double  dtemp;
 
        pp = peer->procptr;
@@ -1266,11 +1267,17 @@ chu_poll(
                up->errflg = CEVNT_TIMEOUT;
        else
                pp->polls++;
+
+       /*
+        * If once in sync and the radio has not been heard for awhile
+        * (30 m), it is no longer reachable. If not heard in a long
+        * while (one day), turn out the lights and start from scratch.
+        */
        minset = ((current_time - peer->update) + 30) / 60;
        if (up->status & INSYNC) {
                if (minset > PANIC)
                        up->status = 0;
-               else
+               else if (minset <= HOLD)
                        peer->reach |= 1;
        }
 
@@ -1338,11 +1345,24 @@ chu_poll(
        pp->lencode = strlen(pp->a_lastcode);
 
        /*
-        * If timestamps have been stuffed, the timecode is ipso fatso
-        * correct and can be selected to discipline the clock.
+        * If in sync and the signal metric is above threshold, the
+        * timecode is ipso fatso valid and can be selected to
+        * discipline the clock. Be sure not to leave stray timestamps
+        * around if signals are too weak or the clock time is invalid.
         */
        if (up->status & INSYNC && dtemp > METRIC) {
-               refclock_receive(peer);
+               if (!clocktime(pp->day, pp->hour, pp->minute, 0, GMT,
+                   up->tstamp[0].l_ui, &pp->yearstart, &offset.l_ui)) {
+                       up->errflg = CEVNT_BADTIME;
+               } else {
+                       offset.l_uf = 0;
+                       for (i = 0; i < up->ntstamp; i++)
+                               refclock_process_offset(pp, offset,
+                                   up->tstamp[i], FUDGE +
+                                   pp->fudgetime1);
+                       pp->lastref = up->timestamp;
+                       refclock_receive(peer);
+               }
                record_clock_stats(&peer->srcadr, pp->a_lastcode);
        } else if (pp->sloppyclockflag & CLK_FLAG4) {
                record_clock_stats(&peer->srcadr, pp->a_lastcode);
@@ -1374,7 +1394,6 @@ chu_major(
        struct chuunit *up;
 
        u_char  code[11];       /* decoded timecode */
-       l_fp    offset;         /* l_fp temps */
        int     mindist;        /* minimum distance */
        int     val1, val2;     /* maximum distance */
        int     synchar;        /* stray cat */
@@ -1387,18 +1406,18 @@ chu_major(
        /*
         * Majority decoder. Each burst encodes two replications at each
         * digit position in the timecode. Each row of the decoding
-        * matrix encodes the number of occurences of each digit found
+        * matrix encodes the number of occurrences of each digit found
         * at the corresponding position. The maximum over all
-        * occurences at each position is the distance for this position
-        * and the corresponding digit is the maximumn likelihood
-        * candidate. If the distance is zero, assume a miss '_'; if the
-        * distance is not more than half the total number of
-        * occurences, assume a soft error '*'; if two different digits
-        * with the same distance are found, assume a hard error '='.
-        * These will later cause a format error when the timecode is
-        * interpreted. The decoding distance is defined as the minimum
-        * distance over the first nine digits. The tenth digit varies
-        * over the seconds, so we don't count it.
+        * occurrences at each position is the distance for this
+        * position and the corresponding digit is the maximum
+        * likelihood candidate. If the distance is zero, assume a miss
+        * '_'; if the distance is not more than half the total number
+        * of occurrences, assume a soft error '*'; if two different
+        * digits with the same distance are found, assume a hard error
+        * '='. These will later cause a format error when the timecode
+        * is interpreted. The decoding distance is defined as the
+        * minimum distance over the first nine digits. The tenth digit
+        * varies over the seconds, so we don't count it.
         */
        mindist = 16;
        for (i = 0; i < 9; i++) {
@@ -1428,7 +1447,7 @@ chu_major(
 
        /*
         * A valid timecode requires a minimum distance at least half
-        * the total number of occurences. A valid timecode also
+        * the total number of occurrences. A valid timecode also
         * requires at least 20 valid timestamps.
         */
        if (up->burstcnt < MINBURST || mindist < up->burstcnt)
@@ -1452,16 +1471,6 @@ chu_major(
                up->errflg = CEVNT_BADREPLY;
                return (0);
        }
-       if (!clocktime(pp->day, pp->hour, pp->minute, 0, GMT,
-           up->tstamp[0].l_ui, &pp->yearstart, &offset.l_ui)) {
-               up->errflg = CEVNT_BADTIME;
-               return (0);
-       }
-       offset.l_uf = 0;
-       for (i = 0; i < up->ntstamp; i++)
-               refclock_process_offset(pp, offset, up->tstamp[i],
-                   FUDGE + pp->fudgetime1);
-       pp->lastref = up->timestamp;
        return (mindist * 100. / (2. * up->burstcnt));
 }
 
@@ -1532,7 +1541,7 @@ chu_newchan(
        sp->metric -= sp->integ[sp->iptr];
        sp->integ[sp->iptr] = met;
        sp->metric += sp->integ[sp->iptr];
-       sp->iptr = (sp->iptr + 1) % NSTAGE;
+       sp->iptr = (sp->iptr + 1) % ISTAGE;
        metric = 0;
        j = 0;
        for (i = 0; i < NCHAN; i++) {
index 0435ad5c0ff9610187092550f184507abb32299e..7acb11b2de92ea72a138b7e4ce04e8a8dc4cab16 100644 (file)
@@ -947,7 +947,7 @@ mx4200_receive(
  *     10 int  User Time Bias: Operator specified bias, in nanoseconds
  *     11 int  Leap Second Flag: Indicates that a leap second will
  *                     occur.  This value is usually zero, except during
- *                     the week prior to the leap second occurence, when
+ *                     the week prior to the leap second occurrence, when
  *                     this value will be set to +1 or -1.  A value of
  *                     +1 indicates that GPS time will be 1 second
  *                     further ahead of UTC time.
index dde0e32e2e32d9e7af905fa8d80ca6bce7116f94..6337f63b1ae78b70b181966ca698a631999e88b5 100644 (file)
@@ -4704,7 +4704,7 @@ int print_msg_table_header (int rptcode, char *HdrStr, int force)
 {
        /* force header is to help auto-output function */
        /* last_rptcode is to determine whether to print a header */
-       /* for the first occurence of a series of reports */
+       /* for the first occurrence of a series of reports */
        static int
                last_rptcode = 0;
    int
index c59cc3f182efef984b0ebb47aef4d6bcbe75638f..031647f7b991083e8fcce8ae2a4525ca33f36d1e 100644 (file)
@@ -177,7 +177,7 @@ static char skip_adjust  = 1;       /* discard first adjustment (bad samples) */
  */
 #define DCFB_ANNOUNCE           0x0001 /* switch time zone warning (DST switch) */
 #define DCFB_DST                0x0002 /* DST in effect */
-#define DCFB_LEAP              0x0004 /* LEAP warning (1 hour prior to occurence) */
+#define DCFB_LEAP              0x0004 /* LEAP warning (1 hour prior to occurrence) */
 #define DCFB_ALTERNATE         0x0008 /* alternate antenna used */
 
 struct clocktime               /* clock time broken up from time code */
index afdc89db6a746d0ea1b8f7bc096bc2fad9448f7d..e3b71f319a3774dc1ec20cef507725a61b1406d7 100644 (file)
@@ -28,7 +28,7 @@
  */
 #define DCFB_ANNOUNCE           0x0001 /* switch time zone warning (DST switch) */
 #define DCFB_DST                0x0002 /* DST in effect */
-#define DCFB_LEAP              0x0004 /* LEAP warning (1 hour prior to occurence) */
+#define DCFB_LEAP              0x0004 /* LEAP warning (1 hour prior to occurrence) */
 #define DCFB_ALTERNATE         0x0008 /* alternate antenna used */
 
 struct clocktime               /* clock time broken up from time code */