From 0d690c9b45a6acb78f75c04733dc7e1777ddb2c6 Mon Sep 17 00:00:00 2001 From: Atten Date: Wed, 10 Apr 2024 13:43:57 +0700 Subject: [PATCH] Fix crash and reboot --- lib/LibAPRS_ESP32S3/AFSK.cpp | 3 +-- lib/LibAPRS_ESP32S3/AX25.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/LibAPRS_ESP32S3/AFSK.cpp b/lib/LibAPRS_ESP32S3/AFSK.cpp index 325dd9b..a5eb2a5 100644 --- a/lib/LibAPRS_ESP32S3/AFSK.cpp +++ b/lib/LibAPRS_ESP32S3/AFSK.cpp @@ -884,8 +884,7 @@ void AFSK_Poll(bool SA818, bool RFPower) if (input_HPF) { adcVal = (int)filter(&hpf, (int16_t)adcVal); - } - if (input_BPF) + }else if (input_BPF) { adcVal = (int)filter(&bpf, (int16_t)adcVal); } diff --git a/lib/LibAPRS_ESP32S3/AX25.cpp b/lib/LibAPRS_ESP32S3/AX25.cpp index 7cd493e..42a533a 100644 --- a/lib/LibAPRS_ESP32S3/AX25.cpp +++ b/lib/LibAPRS_ESP32S3/AX25.cpp @@ -109,16 +109,20 @@ void ax25_poll(AX25Ctx *ctx) { if (!ctx->escape && c == HDLC_FLAG) { - if (ctx->frame_len >= AX25_MIN_FRAME_LEN) - { + // if (ctx->frame_len >= AX25_MIN_FRAME_LEN) + // { if (ctx->crc_in == AX25_CRC_CORRECT) { - ax25_decode(ctx); + //End Flag 7E + ctx->sync = false; + ctx->crc_in = CRC_CCIT_INIT_VAL; + ctx->frame_len = 0; + continue; } - } + //} + //Sync and Start Flag 7E ctx->sync = true; ctx->crc_in = CRC_CCIT_INIT_VAL; - ctx->frame_len = 0; continue; } @@ -148,7 +152,7 @@ void ax25_poll(AX25Ctx *ctx) ctx->sync = false; ctx->escape = true; ctx->frame_len = 0; - ctx->crc_in = CRC_CCIT_INIT_VAL; + memset(ctx->buf,0,sizeof(ctx->buf)); } } else