From: Harlan Stenn Date: Sun, 30 Mar 2003 21:51:05 +0000 (-0500) Subject: Typo fixes from Thomas Klausner X-Git-Tag: NTP_4_1_80_RC1~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1ff0a40c7e98f0fd9f71f478a99ddeb8d867994;p=thirdparty%2Fntp.git Typo fixes from Thomas Klausner bk: 3e8766c9MN_M9aHvLjEIBwkoBirDrg --- diff --git a/html/mx4200data.html b/html/mx4200data.html index ec7dcfc398..c2ab03a2d9 100644 --- a/html/mx4200data.html +++ b/html/mx4200data.html @@ -1058,7 +1058,7 @@ 11 - 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. + 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.   Int -1,0,1 diff --git a/ntpd/refclock_chu.c b/ntpd/refclock_chu.c index 4c69c2fa2c..2344e2678d 100644 --- a/ntpd/refclock_chu.c +++ b/ntpd/refclock_chu.c @@ -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. @@ -197,8 +197,7 @@ #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 @@ -233,7 +232,8 @@ #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++) { diff --git a/ntpd/refclock_mx4200.c b/ntpd/refclock_mx4200.c index 0435ad5c0f..7acb11b2de 100644 --- a/ntpd/refclock_mx4200.c +++ b/ntpd/refclock_mx4200.c @@ -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. diff --git a/ntpd/refclock_ripencc.c b/ntpd/refclock_ripencc.c index dde0e32e2e..6337f63b1a 100644 --- a/ntpd/refclock_ripencc.c +++ b/ntpd/refclock_ripencc.c @@ -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 diff --git a/parseutil/dcfd.c b/parseutil/dcfd.c index c59cc3f182..031647f7b9 100644 --- a/parseutil/dcfd.c +++ b/parseutil/dcfd.c @@ -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 */ diff --git a/parseutil/testdcf.c b/parseutil/testdcf.c index afdc89db6a..e3b71f319a 100644 --- a/parseutil/testdcf.c +++ b/parseutil/testdcf.c @@ -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 */