Only use the CTCSS delay when not using COS.

This commit is contained in:
Jonathan Naylor 2020-05-10 17:15:54 +01:00
parent 85acdc7121
commit 66ea3ad0d1
1 changed files with 6 additions and 5 deletions

5
FM.cpp
View File

@ -70,9 +70,11 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
uint8_t ctcssState = m_ctcssRX.process(currentSample); uint8_t ctcssState = m_ctcssRX.process(currentSample);
if (!m_useCOS) {
// Delay the audio by 100ms to better match the CTCSS detector output // Delay the audio by 100ms to better match the CTCSS detector output
m_inputRB.put(currentSample); m_inputRB.put(currentSample);
m_inputRB.get(currentSample); m_inputRB.get(currentSample);
}
if (CTCSS_NOT_READY(ctcssState) && m_modemState != STATE_FM) { if (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
@ -130,10 +132,9 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
void CFM::process() void CFM::process()
{ {
q15_t sample; 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); io.write(STATE_FM, &sample, 1U);
} }
}
void CFM::reset() void CFM::reset()
{ {