Skip to content

Commit

Permalink
Fix crash and reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
nakhonthai committed Apr 10, 2024
1 parent f9d3917 commit 0d690c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/LibAPRS_ESP32S3/AFSK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
16 changes: 10 additions & 6 deletions lib/LibAPRS_ESP32S3/AX25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0d690c9

Please sign in to comment.