Resetting M17 frame decoder when demodulator transitions from unlocked to locked state

This commit is contained in:
Silvano Seva 2022-07-22 22:54:57 +02:00
parent 9c2091c060
commit 5ebdb36ffb
1 changed files with 9 additions and 2 deletions

View File

@ -144,7 +144,6 @@ void OpMode_M17::rxState(rtxStatus_t *const status)
{
if(startRx)
{
decoder.reset();
demodulator.startBasebandSampling();
demodulator.invertPhase(status->invertRxPhase);
@ -157,7 +156,15 @@ void OpMode_M17::rxState(rtxStatus_t *const status)
}
bool newData = demodulator.update();
locked = demodulator.isLocked();
bool lock = demodulator.isLocked();
// Reset frame decoder when transitioning from unlocked to locked state
if((lock == true) && (locked == false))
{
decoder.reset();
}
locked = lock;
if(locked && newData)
{