From 3f960f9fc5e8fc7279edc2fe4f8a550221d6bc56 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Wed, 20 May 2020 22:30:55 +0200 Subject: [PATCH 1/3] Fix Callsignatend and simplify Samples --- FM.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/FM.cpp b/FM.cpp index e78fd37..31d7ad5 100644 --- a/FM.cpp +++ b/FM.cpp @@ -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 bool validCTCSS = CTCSS_VALID(ctcssState); stateMachine(validCTCSS && cos, inputExt); - } else if ((inputExt || CTCSS_READY(ctcssState)) && m_modemState == STATE_FM) { - //We had enough samples for CTCSS and we are in FM mode, trigger the state machine - bool validCTCSS = CTCSS_VALID(ctcssState); - stateMachine(validCTCSS && cos, inputExt); + if (m_modemState != STATE_FM) + continue; } 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 //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; } - if (m_state == FS_LISTENING) { + if (m_state == FS_LISTENING && !m_callsign.isRunning()) { m_outputRFRB.reset(); m_downsampler.reset(); } From 3cc5d676963de069db43f61bd35aedfc0a36b74d Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Wed, 20 May 2020 22:51:22 +0200 Subject: [PATCH 2/3] check acks --- FM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FM.cpp b/FM.cpp index 31d7ad5..8660615 100644 --- a/FM.cpp +++ b/FM.cpp @@ -316,7 +316,7 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal) break; } - if (m_state == FS_LISTENING && !m_callsign.isRunning()) { + if (m_state == FS_LISTENING && !m_rfAck.isRunning() && !m_extAck.isRunning()) { m_outputRFRB.reset(); m_downsampler.reset(); } From f9f81b9b8eda8321166808eabe79204cd51ea4eb Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 18 May 2020 11:09:56 +0100 Subject: [PATCH 3/3] Try and make the closing callsign appear. (cherry picked from commit 063b21f9991e4da949d11ca901127da64c66f664) --- FM.cpp | 2 +- FMKeyer.cpp | 5 +++++ FMKeyer.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/FM.cpp b/FM.cpp index 8660615..de26c10 100644 --- a/FM.cpp +++ b/FM.cpp @@ -316,7 +316,7 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal) break; } - if (m_state == FS_LISTENING && !m_rfAck.isRunning() && !m_extAck.isRunning()) { + if (m_state == FS_LISTENING && !m_rfAck.isWanted() && !m_extAck.isWanted() && !m_callsign.isWanted()) { m_outputRFRB.reset(); m_downsampler.reset(); } diff --git a/FMKeyer.cpp b/FMKeyer.cpp index 8109fb0..851441e 100644 --- a/FMKeyer.cpp +++ b/FMKeyer.cpp @@ -205,6 +205,11 @@ void CFMKeyer::stop() m_audioPos = 0U; } +bool CFMKeyer::isWanted() const +{ + return m_wanted; +} + bool CFMKeyer::isRunning() const { return m_poPos > 0U || m_dotPos > 0U || m_audioPos > 0U; diff --git a/FMKeyer.h b/FMKeyer.h index 799e85c..5b7bef5 100644 --- a/FMKeyer.h +++ b/FMKeyer.h @@ -35,6 +35,8 @@ public: bool isRunning() const; + bool isWanted() const; + private: bool m_wanted; uint8_t m_poBuffer[1000U];