From 8c38fdb36d22af2919791d83ddbd3e82381d0df2 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sat, 25 Apr 2020 17:37:37 +0100 Subject: [PATCH] Clean out the CTCSS decoder coefficient before initialising. --- FMCTCSSRX.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FMCTCSSRX.cpp b/FMCTCSSRX.cpp index 6251f63..164af75 100644 --- a/FMCTCSSRX.cpp +++ b/FMCTCSSRX.cpp @@ -92,6 +92,8 @@ m_result(CTS_NONE) uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold) { + m_coeffDivTwo = 0; + for (uint8_t i = 0U; i < CTCSS_TABLE_DATA_LEN; i++) { if (RX_CTCSS_TABLE_DATA[i].frequency == frequency) { m_coeffDivTwo = RX_CTCSS_TABLE_DATA[i].coeffDivTwo;