Browse Source

Updated ax25_recving()

Stephen Downward 4 months ago
parent
commit
9b2c2fec66
2 changed files with 6 additions and 3 deletions
  1. 6 0
      LibAPRS/AFSK.cpp
  2. 0 3
      LibAPRS/AX25.cpp

+ 6 - 0
LibAPRS/AFSK.cpp

@ -11,6 +11,7 @@ bool hw_afsk_dac_isr = false;
11 11
bool hw_5v_ref = false;
12 12
Afsk *AFSK_modem;
13 13
14
extern void ax25_recving(int starting);
14 15
15 16
// Forward declerations
16 17
int afsk_getchar(void);
@ -195,6 +196,7 @@ static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
195 196
            // on the RX LED.
196 197
            fifo_push(fifo, HDLC_FLAG);
197 198
            hdlc->receiving = true;
199
            ax25_recving(0);
198 200
        } else {
199 201
            // If the buffer is full, we have a problem
200 202
            // and abort by setting the return value to
@ -202,6 +204,7 @@ static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
202 204
203 205
            ret = false;
204 206
            hdlc->receiving = false;
207
            ax25_recving(0);
205 208
        }
206 209
207 210
        // Everytime we receive a HDLC_FLAG, we reset the
@ -225,6 +228,7 @@ static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
225 228
        // If we have, something probably went wrong at the
226 229
        // transmitting end, and we abort the reception.
227 230
        hdlc->receiving = false;
231
        ax25_recving(0);
228 232
        return ret;
229 233
    }
230 234
@ -280,6 +284,7 @@ static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
280 284
            } else {
281 285
                // If it is, abort and return false
282 286
                hdlc->receiving = false;
287
                ax25_recving(0);
283 288
                ret = false;
284 289
            }
285 290
        }
@ -291,6 +296,7 @@ static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
291 296
        } else {
292 297
            // If it is, well, you know by now!
293 298
            hdlc->receiving = false;
299
            ax25_recving(0);
294 300
            ret = false;
295 301
        }
296 302

+ 0 - 3
LibAPRS/AX25.cpp

@ -16,8 +16,6 @@
16 16
extern int LibAPRS_vref;
17 17
extern bool LibAPRS_open_squelch;
18 18
19
extern void ax25_recving();
20
21 19
void ax25_init(AX25Ctx *ctx, ax25_callback_t hook) {
22 20
    memset(ctx, 0, sizeof(*ctx));
23 21
    ctx->hook = hook;
@ -66,7 +64,6 @@ void ax25_poll(AX25Ctx *ctx) {
66 64
        if (!ctx->escape && c == HDLC_FLAG) {
67 65
            if (ctx->frame_len >= AX25_MIN_FRAME_LEN) {
68 66
                if (ctx->crc_in == AX25_CRC_CORRECT) {
69
                    ax25_recving();
70 67
                    ax25_decode(ctx);
71 68
                }
72 69
            }