From ccdbe126e01c887076397c2253b7b170ef6b9f81 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sun, 12 Jul 2020 15:22:35 +0100 Subject: [PATCH] Fix the timeout tones. --- FM.cpp | 4 ++-- FMTimeout.cpp | 8 ++++---- SerialPort.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FM.cpp b/FM.cpp index ae44e07..458fc28 100644 --- a/FM.cpp +++ b/FM.cpp @@ -117,11 +117,11 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) currentSample += m_callsign.getLowAudio(); } + currentSample = m_filterStage3.filter(m_filterStage2.filter(m_filterStage1.filter(currentSample))); + if (!m_callsign.isRunning() && !m_rfAck.isRunning()) currentSample += m_timeoutTone.getAudio(); - currentSample = m_filterStage3.filter(m_filterStage2.filter(m_filterStage1.filter(currentSample))); - currentSample += m_ctcssTX.getAudio(); if (m_modemState == STATE_FM) diff --git a/FMTimeout.cpp b/FMTimeout.cpp index 4c1fb55..771e840 100644 --- a/FMTimeout.cpp +++ b/FMTimeout.cpp @@ -36,7 +36,7 @@ m_n(0U) void CFMTimeout::setParams(uint8_t level) { - m_level = q15_t(level * 128); + m_level = q15_t(level * 5); } q15_t CFMTimeout::getAudio() @@ -45,9 +45,9 @@ q15_t CFMTimeout::getAudio() if (!m_running) return sample; - if (m_pos > 12000U) { - q31_t sample = BUSY_AUDIO[m_n] * m_level; - sample = q15_t(__SSAT((sample >> 15), 16)); + if (m_pos >= 12000U) { + q31_t sample31 = BUSY_AUDIO[m_n] * m_level; + sample = q15_t(__SSAT((sample31 >> 15), 16)); m_n++; if (m_n >= BUSY_AUDIO_LEN) diff --git a/SerialPort.cpp b/SerialPort.cpp index 338f5f9..4e22028 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -103,7 +103,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U; #define HW_TYPE "MMDVM" #endif -#define DESCRIPTION "20200520 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)" +#define DESCRIPTION "20200712 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)" #if defined(GITVERSION) #define concat(h, a, b, c) h " " a " " b " GitID #" c ""