From 0e8fdb381ab8390e9ac9e427a3972ae41d984e67 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sun, 10 May 2020 09:07:21 +0200 Subject: [PATCH] Fix State machine not changing state --- FM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FM.cpp b/FM.cpp index 8bf2448..a6085c3 100644 --- a/FM.cpp +++ b/FM.cpp @@ -85,8 +85,8 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) q15_t currentExtSample; 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) { - //Not enough samples to determine if you have CTCSS, just carry on. + if (!inputExt && (CTCSS_NOT_READY(ctcssState)) && m_modemState != STATE_FM) { + //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; } 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