~ubuntu-branches/ubuntu/breezy/soundmodem/breezy

« back to all changes in this revision

Viewing changes to newqpsk/newqpsktx.c

  • Committer: Bazaar Package Importer
  • Author(s): Joop Stakenborg
  • Date: 2005-02-06 20:29:45 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050206202945-m1lx3dlyznuv8qsw
Tags: 0.9-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
        /* switch to tune mode */
35
35
        s->txroutine = txtune;
36
 
        s->statecntr = TxTuneLen;
 
36
        s->statecntr = s->tunelen;
37
37
        s->txwindowfunc = ToneWindowOut;
38
38
 
39
39
        /* copy initial tune vectors */
45
45
 
46
46
/* --------------------------------------------------------------------- */
47
47
 
48
 
static unsigned getbitbatch(void *state)
 
48
static int getbyte(void *state, unsigned char *buf)
 
49
{
 
50
        struct txstate *s = (struct txstate *)state;
 
51
 
 
52
        if (s->saved != -1) {
 
53
                *buf = (unsigned char) s->saved;
 
54
                s->saved = -1;
 
55
                return 1;
 
56
        }
 
57
        return pktget(s->chan, buf, 1);
 
58
}
 
59
 
 
60
static unsigned int getbitbatch(void *state)
49
61
{
50
62
        struct txstate *s = (struct txstate *)state;
51
63
        unsigned int i, bit, data = 0;
53
65
 
54
66
        for (i = 0; i < s->fec.bitbatchlen; i++) {
55
67
                if (s->shreg <= 1) {
56
 
                        if (pktget(s->chan, &buf, 1))
 
68
                        if (!getbyte(s, &buf))
57
69
                                break;
58
70
                        s->shreg = buf;
59
71
                        s->shreg |= 0x100;
181
193
        if (!s->tuneonly && --s->statecntr <= 0) {
182
194
                /* switch to sync mode */
183
195
                s->txroutine = txsync;
184
 
                s->statecntr = TxSyncLen;
 
196
                s->statecntr = s->synclen;
185
197
                s->txwindowfunc = DataWindowOut;
186
198
        }
187
199
}