From 604273742af37289ad7fe1f24bf725b8364ed02a Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 6 Jun 2017 02:16:28 +0200 Subject: [PATCH] AF squelch: reset after setting threshold. Removed NFM demod deferred init --- plugins/channelrx/demodnfm/nfmdemodgui.cpp | 9 +-------- plugins/channelrx/demodnfm/nfmdemodgui.h | 1 - sdrbase/dsp/afsquelch.cpp | 1 + 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index 1f8631a3e..e27109745 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -272,8 +272,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg m_channelMarker(this), m_basicSettingsShown(false), m_doApplySettings(true), - m_squelchOpen(false), - m_autoInitCount(0) + m_squelchOpen(false) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); @@ -429,10 +428,4 @@ void NFMDemodGUI::tick() m_squelchOpen = squelchOpen; } - - if (m_autoInitCount < 100) // ~5s - { - if (m_autoInitCount == 99) applySettings(true); - m_autoInitCount++; - } } diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index 5b49a2445..0bc78d9ec 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -69,7 +69,6 @@ private: bool m_ctcssOn; bool m_audioMute; bool m_squelchOpen; - uint32_t m_autoInitCount; static const int m_rfBW[]; static const int m_fmDev[]; diff --git a/sdrbase/dsp/afsquelch.cpp b/sdrbase/dsp/afsquelch.cpp index e1188e126..84409ca4d 100644 --- a/sdrbase/dsp/afsquelch.cpp +++ b/sdrbase/dsp/afsquelch.cpp @@ -304,4 +304,5 @@ void AFSquelch::setThreshold(double threshold) { qDebug("AFSquelch::setThreshold: threshold: %f", threshold); m_threshold = threshold; + reset(); }