From 2d66da14a46c93c2a5fe33985a3aa624dd7d6950 Mon Sep 17 00:00:00 2001 From: Haylz Date: Tue, 11 Jun 2019 16:47:24 -0500 Subject: [PATCH] RX State Machine HEADER_PROCESSING to BIT_FRAME_SYNC The header processing stage always switched to the VOICE_FRAME stage. This caused garbage to be loaded into decode buffers. This fix changes the logic to only switche from HEADER_PROCESS stage to VOICE_FRAME stage if there is a P_FCS match, otherwise goes back to the BIT_FRAME_SYNC stage. --- DSP_API/ThumbDV/dstar.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DSP_API/ThumbDV/dstar.c b/DSP_API/ThumbDV/dstar.c index b2a2ff7..12bef54 100644 --- a/DSP_API/ThumbDV/dstar.c +++ b/DSP_API/ThumbDV/dstar.c @@ -951,15 +951,20 @@ BOOL dstar_rxStateMachine( DSTAR_MACHINE machine, BOOL in_bit, unsigned char * a dstar_updateStatus( machine, machine->slice, STATUS_RX ); + machine->rx_state = VOICE_FRAME; + machine->bit_count = 0; + machine->frame_count = 0; + } else { output( ANSI_RED "P_FCS Does Not Match!\n" ANSI_WHITE ); + + machine->rx_state = BIT_FRAME_SYNC; + machine->bit_count = 0; } /* STATE CHANGE */ - machine->rx_state = VOICE_FRAME; - machine->bit_count = 0; - machine->frame_count = 0; + } break;