From 3c337d6cf5f88c90b71d08e25d950f9cd87017e7 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 15 Jul 2024 03:45:04 +0200 Subject: [PATCH] WDSP receiver: implemented SAM DSB/USB/LSB selection --- plugins/channelrx/wdsprx/wdsprxgui.cpp | 19 ++++++++++++++++++- plugins/channelrx/wdsprx/wdsprxsink.cpp | 19 +++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/plugins/channelrx/wdsprx/wdsprxgui.cpp b/plugins/channelrx/wdsprx/wdsprxgui.cpp index 540fb40e8..8198bbe0b 100644 --- a/plugins/channelrx/wdsprx/wdsprxgui.cpp +++ b/plugins/channelrx/wdsprx/wdsprxgui.cpp @@ -409,15 +409,16 @@ void WDSPRxGUI::on_demod_currentIndexChanged(int index) switch(m_settings.m_demod) { case WDSPRxProfile::DemodSSB: + case WDSPRxProfile::DemodSAM: break; case WDSPRxProfile::DemodAM: - case WDSPRxProfile::DemodSAM: case WDSPRxProfile::DemodFMN: m_settings.m_dsb = true; break; default: break; } + displaySettings(); applyBandwidths(m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2, true); // does applySettings(true) } @@ -829,6 +830,22 @@ void WDSPRxGUI::displaySettings() ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->fftWindow->setCurrentIndex(m_settings.m_profiles[m_settings.m_profileIndex].m_fftWindow); + // DSB enable/disable + switch(m_settings.m_demod) + { + case WDSPRxProfile::DemodSSB: + case WDSPRxProfile::DemodSAM: + ui->dsb->setEnabled(true); + break; + case WDSPRxProfile::DemodAM: + case WDSPRxProfile::DemodFMN: + ui->dsb->setEnabled(false); + break; + default: + ui->dsb->setEnabled(true); + break; + } + // Prevent uncontrolled triggering of applyBandwidths ui->spanLog2->blockSignals(true); ui->dsb->blockSignals(true); diff --git a/plugins/channelrx/wdsprx/wdsprxsink.cpp b/plugins/channelrx/wdsprx/wdsprxsink.cpp index a03704f48..4cfc42634 100644 --- a/plugins/channelrx/wdsprx/wdsprxsink.cpp +++ b/plugins/channelrx/wdsprx/wdsprxsink.cpp @@ -451,17 +451,10 @@ void WDSPRxSink::applySettings(const WDSPRxSettings& settings, bool force) if (settings.m_demod == WDSPRxProfile::DemodSSB) { - if (dsb) - { + if (dsb) { WDSP::RXA::SetMode(*m_rxa, WDSP::RXA::RXA_DSB); - } - else - { - if (usb) { - WDSP::RXA::SetMode(*m_rxa, WDSP::RXA::RXA_USB); - } else { - WDSP::RXA::SetMode(*m_rxa, WDSP::RXA::RXA_LSB); - } + } else { + WDSP::RXA::SetMode(*m_rxa, usb ? WDSP::RXA::RXA_USB : WDSP::RXA::RXA_LSB); } } else if (settings.m_demod == WDSPRxProfile::DemodAM) @@ -471,6 +464,12 @@ void WDSPRxSink::applySettings(const WDSPRxSettings& settings, bool force) else if (settings.m_demod == WDSPRxProfile::DemodSAM) { WDSP::RXA::SetMode(*m_rxa, WDSP::RXA::RXA_SAM); + + if (dsb) { + WDSP::AMD::SetAMDSBMode(*m_rxa, 0); + } else { + WDSP::AMD::SetAMDSBMode(*m_rxa, usb ? 2 : 1); + } } else if (settings.m_demod == WDSPRxProfile::DemodFMN) {