diff --git a/openrtx/src/protocols/M17/M17Demodulator.cpp b/openrtx/src/protocols/M17/M17Demodulator.cpp index 66b839d5..61df2c79 100644 --- a/openrtx/src/protocols/M17/M17Demodulator.cpp +++ b/openrtx/src/protocols/M17/M17Demodulator.cpp @@ -523,10 +523,15 @@ bool M17Demodulator::update() if ((hammingSync > maxHamming) && (hammingLsf > maxHamming)) { - // Lock lost + // Lock lost, reset demodulator alignment (phase) only + // if we were locked on a valid signal. + // This to avoid, in case of absence of carrier, to fall + // in a loop where the demodulator continues to search + // for the syncword in the same block of samples, causing + // the update function to take more than 20ms to complete. + if(locked) phase = 0; syncDetected = false; locked = false; - phase = 0; #ifdef ENABLE_DEMOD_LOG // Pre-arm the log trigger.