From 66ea3ad0d11cc6e705e2e32c0668bce109ed85fb Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sun, 10 May 2020 17:15:54 +0100 Subject: [PATCH] Only use the CTCSS delay when not using COS. --- FM.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/FM.cpp b/FM.cpp index 6a14e45..6d2e0e3 100644 --- a/FM.cpp +++ b/FM.cpp @@ -70,9 +70,11 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) uint8_t ctcssState = m_ctcssRX.process(currentSample); - // Delay the audio by 100ms to better match the CTCSS detector output - m_inputRB.put(currentSample); - m_inputRB.get(currentSample); + if (!m_useCOS) { + // Delay the audio by 100ms to better match the CTCSS detector output + m_inputRB.put(currentSample); + m_inputRB.get(currentSample); + } if (CTCSS_NOT_READY(ctcssState) && m_modemState != STATE_FM) { //Not enough samples to determine if you have CTCSS, just carry on @@ -130,9 +132,8 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) void CFM::process() { q15_t sample; - while(io.getSpace() >= 3U && m_outputRB.get(sample)) { + while(io.getSpace() >= 3U && m_outputRB.get(sample)) io.write(STATE_FM, &sample, 1U); - } } void CFM::reset()