diff options
Diffstat (limited to 'main/fskmodem.c')
-rw-r--r-- | main/fskmodem.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/fskmodem.c b/main/fskmodem.c index cd48d484e..f77300979 100644 --- a/main/fskmodem.c +++ b/main/fskmodem.c @@ -225,7 +225,9 @@ int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte) int i,j,n1,r; int samples = 0; int olen; - + int beginlen=*len; + int beginlenx; + switch (fskd->state) { /* Pick up where we left off */ case STATE_SEARCH_STARTBIT2: @@ -253,12 +255,13 @@ int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte) beginning of a start bit in the TDD sceanario. It just looks for sufficient level to maybe, perhaps, guess, maybe that its maybe the beginning of a start bit, perhaps. This whole thing stinks! */ + beginlenx=beginlen; /* just to avoid unused war warnings */ if (demodulator(fskd, &fskd->x1, GET_SAMPLE)) return -1; samples++; for (;;) { search_startbit2: - if (!*len) { + if (*len <= 0) { fskd->state = STATE_SEARCH_STARTBIT2; return 0; } @@ -278,7 +281,7 @@ search_startbit3: fskd->state = STATE_SEARCH_STARTBIT3; return 0; } - for (; i; i--) { + for (; i>0; i--) { if (demodulator(fskd, &fskd->x1, GET_SAMPLE)) return(-1); #if 0 |