Clean out the CTCSS decoder coefficient before initialising.

This commit is contained in:
Jonathan Naylor 2020-04-25 17:37:37 +01:00
parent 4fe1c11250
commit 8c38fdb36d
1 changed files with 2 additions and 0 deletions

View File

@ -92,6 +92,8 @@ m_result(CTS_NONE)
uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold) uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold)
{ {
m_coeffDivTwo = 0;
for (uint8_t i = 0U; i < CTCSS_TABLE_DATA_LEN; i++) { for (uint8_t i = 0U; i < CTCSS_TABLE_DATA_LEN; i++) {
if (RX_CTCSS_TABLE_DATA[i].frequency == frequency) { if (RX_CTCSS_TABLE_DATA[i].frequency == frequency) {
m_coeffDivTwo = RX_CTCSS_TABLE_DATA[i].coeffDivTwo; m_coeffDivTwo = RX_CTCSS_TABLE_DATA[i].coeffDivTwo;