Merge pull request #230 from g4klx/revert-229-FM

Revert "Make CTCSS threshold RXLevel and RXBoost agnostic"
This commit is contained in:
Jonathan Naylor 2020-04-25 23:48:25 +01:00 committed by GitHub
commit 4d664c4aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 17 deletions

View File

@ -113,15 +113,6 @@ CTCSSState CFMCTCSSRX::process(q15_t sample)
{
m_result = m_result & (~CTS_READY);
// sample / rxLevel
q15_t rxLevel = io.getRxLevel();
q31_t sample31 = q31_t(sample) << 16;
if (((sample31 >> 31) & 1) == ((rxLevel >> 15) & 1))
sample31 += rxLevel >> 1;
else
sample31 -= rxLevel >> 1;
sample31 /= rxLevel;
q31_t q2 = m_q1;
m_q1 = m_q0;
@ -131,7 +122,7 @@ CTCSSState CFMCTCSSRX::process(q15_t sample)
q31_t t3 = t2 * 2;
// m_q0 = m_coeffDivTwo * m_q1 * 2 - q2 + sample
m_q0 = t3 - q2 + sample31;
m_q0 = t3 - q2 + q31_t(sample);
m_count++;
if (m_count == N) {
@ -152,6 +143,7 @@ CTCSSState CFMCTCSSRX::process(q15_t sample)
// value = m_q0 * m_q0 + m_q1 * m_q1 - m_q0 * m_q1 * m_coeffDivTwo * 2
q31_t value = t2 + t4 - t9;
m_result = m_result | CTS_READY;
if (value >= m_threshold)
m_result = m_result | CTS_VALID;

5
IO.cpp
View File

@ -592,8 +592,3 @@ bool CIO::hasLockout() const
{
return m_lockout;
}
q15_t CIO::getRxLevel() const
{
return m_rxLevel;
}

2
IO.h
View File

@ -56,8 +56,6 @@ public:
void selfTest();
q15_t getRxLevel() const;
private:
bool m_started;