diff options
Diffstat (limited to 'ntpd/refclock_chu.c')
-rw-r--r-- | ntpd/refclock_chu.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ntpd/refclock_chu.c b/ntpd/refclock_chu.c index e0c79e2..843e9aaa 100644 --- a/ntpd/refclock_chu.c +++ b/ntpd/refclock_chu.c @@ -208,12 +208,12 @@ #define BAUD 300 /* modulation rate (bps) */ #define OFFSET 128 /* companded sample offset */ #define SIZE 256 /* decompanding table size */ -#define MAXSIG 6000. /* maximum signal level */ +#define MAXAMP 6000. /* maximum signal level */ #define MAXCLP 100 /* max clips above reference per s */ #define LIMIT 1000. /* soft limiter threshold */ #define AGAIN 6. /* baseband gain */ #define LAG 10 /* discriminator lag */ -#define DEVICE_AUDIO "/dev/chu_audio" /* device name */ +#define DEVICE_AUDIO "/dev/audio" /* device name */ #define DESCRIPTION "CHU Audio/Modem Receiver" /* WRU */ #define AUDIO_BUFSIZ 240 /* audio buffer size (30 ms) */ #else @@ -655,15 +655,15 @@ chu_audio_receive( sample = up->comp[~*dpt++ & 0xff]; /* - * Clip noise spikes greater than MAXSIG. If no clips, + * Clip noise spikes greater than MAXAMP. If no clips, * increase the gain a tad; if the clips are too high, * decrease a tad. */ - if (sample > MAXSIG) { - sample = MAXSIG; + if (sample > MAXAMP) { + sample = MAXAMP; up->clipcnt++; - } else if (sample < -MAXSIG) { - sample = -MAXSIG; + } else if (sample < -MAXAMP) { + sample = -MAXAMP; up->clipcnt++; } chu_rf(peer, sample); @@ -1112,7 +1112,7 @@ chu_b( up->tstamp[up->ntstamp] = up->cstamp[i]; L_SUB(&up->tstamp[up->ntstamp], &offset); L_ADD(&offset, &up->charstamp); - if (up->ntstamp < MAXSTAGE) + if (up->ntstamp < MAXSTAGE - 1) up->ntstamp++; } } @@ -1216,7 +1216,7 @@ chu_a( up->tstamp[up->ntstamp] = up->cstamp[i]; L_SUB(&up->tstamp[up->ntstamp], &offset); L_ADD(&offset, &up->charstamp); - if (up->ntstamp < MAXSTAGE) + if (up->ntstamp < MAXSTAGE - 1) up->ntstamp++; } while (temp > up->prevsec) { @@ -1231,7 +1231,7 @@ chu_a( } i = -(2 * k); for (j = 0; j < nchar; j++) { - if (i < 0 || i > 19) { + if (i < 0 || i > 18) { i += 2; continue; } |