mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Remove dependency to IO in CTCSSRX
This commit is contained in:
parent
1bc8726046
commit
6824d5662a
4 changed files with 20 additions and 14 deletions
|
|
@ -111,17 +111,7 @@ uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold)
|
|||
|
||||
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;
|
||||
|
||||
m_result = m_result & (~CTS_READY);
|
||||
|
||||
q31_t q2 = m_q1;
|
||||
m_q1 = m_q0;
|
||||
|
|
@ -132,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 + sample;
|
||||
|
||||
m_count++;
|
||||
if (m_count == N) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue