Fix Callsignatend and simplify Samples

This commit is contained in:
Geoffrey Merck 2020-05-20 22:30:55 +02:00
parent 489853f200
commit 3f960f9fc5
1 changed files with 3 additions and 5 deletions

8
FM.cpp
View File

@ -97,10 +97,8 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length)
//we had enough samples for CTCSS and we are in some other mode than FM //we had enough samples for CTCSS and we are in some other mode than FM
bool validCTCSS = CTCSS_VALID(ctcssState); bool validCTCSS = CTCSS_VALID(ctcssState);
stateMachine(validCTCSS && cos, inputExt); stateMachine(validCTCSS && cos, inputExt);
} else if ((inputExt || CTCSS_READY(ctcssState)) && m_modemState == STATE_FM) { if (m_modemState != STATE_FM)
//We had enough samples for CTCSS and we are in FM mode, trigger the state machine continue;
bool validCTCSS = CTCSS_VALID(ctcssState);
stateMachine(validCTCSS && cos, inputExt);
} else if ((inputExt || CTCSS_NOT_READY(ctcssState)) && m_modemState == STATE_FM && i == length - 1) { } else if ((inputExt || CTCSS_NOT_READY(ctcssState)) && m_modemState == STATE_FM && i == length - 1) {
//Not enough samples for CTCSS but we already are in FM, trigger the state machine //Not enough samples for CTCSS but we already are in FM, trigger the state machine
//but do not trigger the state machine on every single sample, save CPU! //but do not trigger the state machine on every single sample, save CPU!
@ -318,7 +316,7 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal)
break; break;
} }
if (m_state == FS_LISTENING) { if (m_state == FS_LISTENING && !m_callsign.isRunning()) {
m_outputRFRB.reset(); m_outputRFRB.reset();
m_downsampler.reset(); m_downsampler.reset();
} }