Fix State machine not changing state

This commit is contained in:
Geoffrey Merck 2020-05-10 09:07:21 +02:00
parent 0b31c40c2b
commit 0e8fdb381a
1 changed files with 2 additions and 2 deletions

4
FM.cpp
View File

@ -85,8 +85,8 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
q15_t currentExtSample; q15_t currentExtSample;
bool inputExt = m_inputExtRB.get(currentExtSample);//always consume the external input data so it does not overflow bool inputExt = m_inputExtRB.get(currentExtSample);//always consume the external input data so it does not overflow
if ((!inputExt || CTCSS_NOT_READY(ctcssState)) && m_modemState != STATE_FM) { if (!inputExt && (CTCSS_NOT_READY(ctcssState)) && m_modemState != STATE_FM) {
//Not enough samples to determine if you have CTCSS, just carry on. //Not enough samples to determine if you have CTCSS, just carry on. But only if we haven't any external data in the queue
continue; continue;
} else if ((inputExt || CTCSS_READY(ctcssState)) && m_modemState != STATE_FM) { } else if ((inputExt || CTCSS_READY(ctcssState)) && m_modemState != STATE_FM) {
//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