diff --git a/configs/config.example.yml b/configs/config.example.yml index 18e9c7c1..b35268e4 100644 --- a/configs/config.example.yml +++ b/configs/config.example.yml @@ -600,23 +600,14 @@ system: nxdnFifoLength: 538 # - # Hotspot Modem Configuration + # Hotspot/SDR-based Modem Configuration # hotspot: - # DMR Discriminator Bandwidth Adjustment. - dmrDiscBWAdj: 0 # Valid values between -128 and 128 - # DMR Post Demodulator Bandwidth Adjustment. - dmrPostBWAdj: 0 # Valid values between -128 and 128 - # P25 Discriminator Bandwidth Adjustment. - p25DiscBWAdj: 0 # Valid values between -128 and 128 - # P25 Post Demodulator Bandwidth Adjustment. - p25PostBWAdj: 0 # Valid values between -128 and 128 - # NXDN Discriminator Bandwidth Adjustment. - nxdnDiscBWAdj: 0 # Valid values between -128 and 128 - # NXDN Post Demodulator Bandwidth Adjustment. - nxdnPostBWAdj: 0 # Valid values between -128 and 128 - # LNA Gain Mode. - adfGainMode: 2 # 0 - Auto, 1 - Auto High Lin, 2 - Low, 3 - High + # + # Automatic Frequency Control Configuration + # (This applies to both the ADF7021 based hotspots and SDR based modems, as the same AFC algorithm is + # applied to both types of modems in DVM.) + # # Flag indicating whether the ADF7021's automatic frequency correction is enabled. afcEnable: true # Don't change this. See the ADF7021 datasheet for more information. @@ -626,11 +617,41 @@ system: # Sets the maximum frequency correction range of the ADF7021. # (It is highly recommended *not* to alter this.) afcRange: 1 + + # + # Frequency Offset Configuration + # (This applies to both the ADF7021 based hotspots and SDR based modems, as the same frequency offset + # is applied to both types of modems in DVM.) + # # Sets the transmit frequency offset. (in Hz) txTuning: 0 # Sets the receive frequency offset. (in Hz) rxTuning: 0 + # + # Discriminator and Post Demodulator Bandwidth Adjustment Configuration + # (ADF7021 Hotspot only, this does not apply to SDR based modems.) + # + # DMR Discriminator Bandwidth Adjustment. + dmrDiscBWAdj: 0 # Valid values between -128 and 128 + # DMR Post Demodulator Bandwidth Adjustment. + dmrPostBWAdj: 0 # Valid values between -128 and 128 + # P25 Discriminator Bandwidth Adjustment. + p25DiscBWAdj: 0 # Valid values between -128 and 128 + # P25 Post Demodulator Bandwidth Adjustment. + p25PostBWAdj: 0 # Valid values between -128 and 128 + # NXDN Discriminator Bandwidth Adjustment. + nxdnDiscBWAdj: 0 # Valid values between -128 and 128 + # NXDN Post Demodulator Bandwidth Adjustment. + nxdnPostBWAdj: 0 # Valid values between -128 and 128 + + # + # LNA Gain Mode Configuration + # (ADF7021 Hotspot only, this does not apply to SDR based modems.) + # + # LNA Gain Mode. + adfGainMode: 2 # 0 - Auto, 1 - Auto High Lin, 2 - Low, 3 - High + # # Repeater Modem Configuration # diff --git a/src/host/calibrate/HostCal.cpp b/src/host/calibrate/HostCal.cpp index 8ea8ebdc..274f1fc1 100644 --- a/src/host/calibrate/HostCal.cpp +++ b/src/host/calibrate/HostCal.cpp @@ -798,11 +798,11 @@ void HostCal::displayHelp() if (!m_isHotspot) { LogInfoEx(LOG_CAL, " w Set P25 Correlation Count"); } - if (m_isHotspot) { + if (m_isHotspot || m_isPTY) { LogInfoEx(LOG_CAL, " F Set Rx Frequency Adjustment"); LogInfoEx(LOG_CAL, " f Set Tx Frequency Adjustment"); } - if (!m_isHotspot) { + if (!m_isHotspot && !m_isPTY) { LogInfoEx(LOG_CAL, " 1/2 Increase/Decrease receive coarse level"); LogInfoEx(LOG_CAL, " 3/4 Increase/Decrease receive fine level"); LogInfoEx(LOG_CAL, " 5/6 Increase/Decrease transmit coarse level"); @@ -1055,6 +1055,12 @@ void HostCal::printStatus() m_modem->m_nxdnSymLevel3Adj, m_modem->m_nxdnSymLevel1Adj); } } + + if (m_isHotspot || m_isPTY) { + LogInfoEx(LOG_CAL, " - AFC Enabled: %u, AFC KI: %u, AFC KP: %u, AFC Range: %u", + m_modem->m_afcEnable, m_modem->m_afcKI, m_modem->m_afcKP, m_modem->m_afcRange); + } + if (m_isHotspot) { LogInfoEx(LOG_CAL, " - DMR Disc. BW: %d, P25 Disc. BW: %d, DMR Post Demod BW: %d, P25 Post Demod BW: %d", m_modem->m_dmrDiscBWAdj, m_modem->m_p25DiscBWAdj, m_modem->m_dmrPostBWAdj, m_modem->m_p25PostBWAdj); @@ -1063,9 +1069,6 @@ void HostCal::printStatus() if (m_modem->getVersion() >= 3U) { LogInfoEx(LOG_CAL, " - NXDN Disc. BW: %d, NXDN Post Demod BW: %d", m_modem->m_nxdnDiscBWAdj, m_modem->m_nxdnPostBWAdj); - - LogInfoEx(LOG_CAL, " - AFC Enabled: %u, AFC KI: %u, AFC KP: %u, AFC Range: %u", - m_modem->m_afcEnable, m_modem->m_afcKI, m_modem->m_afcKP, m_modem->m_afcRange); } switch (m_modem->m_adfGainMode) { diff --git a/src/host/setup/HSGainAdjustWnd.h b/src/host/setup/HSGainAdjustWnd.h index 691f5092..139e41c4 100644 --- a/src/host/setup/HSGainAdjustWnd.h +++ b/src/host/setup/HSGainAdjustWnd.h @@ -66,7 +66,7 @@ private: */ void initLayout() override { - FDialog::setText("Hotspot Gain & AFC Adjustment"); + FDialog::setText("AFC & Hotspot Gain Adjustment"); FDialog::setSize(FSize{50, 22}); AdjustWndBase::initLayout(); @@ -183,6 +183,10 @@ private: }); } + if (m_setup->m_isPTY) { + m_gainButtonGroup.setDisable(); + } + AdjustWndBase::initControls(); } }; diff --git a/src/host/setup/LevelAdjustWnd.h b/src/host/setup/LevelAdjustWnd.h index 12ff6db9..4828b9fa 100644 --- a/src/host/setup/LevelAdjustWnd.h +++ b/src/host/setup/LevelAdjustWnd.h @@ -60,7 +60,7 @@ private: FLabel m_dmrRxDelayLabel{"DMR Rx Delay: ", this}; FLabel m_p25CorrCountLabel{"P25 Corr. Count: ", this}; - FLabel m_freqAdjustLabel{"Hotspot Frequency Offset", this}; + FLabel m_freqAdjustLabel{"Hotspot/SDR Frequency Offset", this}; FLabel m_rxFreqAdjLabel{"Rx Freq. Offset: ", this}; FLabel m_txFreqAdjLabel{"Tx Freq. Offset: ", this}; @@ -303,8 +303,14 @@ private: m_txCoarseLevel.setEnable(); m_rssiCoarseLevel.setEnable(); - m_rxTuning.setDisable(); - m_txTuning.setDisable(); + if (m_setup->m_isPTY) { + m_rxTuning.setEnable(); + m_txTuning.setEnable(); + } + else { + m_rxTuning.setDisable(); + m_txTuning.setDisable(); + } } } diff --git a/src/host/setup/SetupMainWnd.h b/src/host/setup/SetupMainWnd.h index 05fae774..63c71a41 100644 --- a/src/host/setup/SetupMainWnd.h +++ b/src/host/setup/SetupMainWnd.h @@ -558,6 +558,10 @@ public: m_adjSymLevel.setEnable(); m_adjHSBandwidth.setDisable(); m_adjHSGain.setDisable(); + + if (m_setup->m_isPTY) { + m_adjHSGain.setEnable(); + } } } } @@ -626,7 +630,7 @@ private: FMenu m_engineeringMenu{"&Engineering", &m_menuBar}; FMenuItem m_adjSymLevel{"&Symbol Level Adjustment", &m_engineeringMenu}; FMenuItem m_adjHSBandwidth{"Hotspot &Bandwidth Adjustment", &m_engineeringMenu}; - FMenuItem m_adjHSGain{"Hotspot &Gain & AFC", &m_engineeringMenu}; + FMenuItem m_adjHSGain{"AFC and Hotspot &Gain", &m_engineeringMenu}; FMenuItem m_engineeringMenuSeparator1{&m_engineeringMenu}; FMenuItem m_adjFifoBuffers{"&FIFO Buffers", &m_engineeringMenu}; FMenuItem m_engineeringMenuSeparator3{&m_engineeringMenu}; @@ -733,12 +737,17 @@ private: m_setup->writeRFParams(); m_setup->getStatus(); - uint8_t timeout = 0U; + uint32_t timeout = 0U; + uint32_t maxTimeout = 75U; // ~375ms + if (m_setup->m_isPTY) { + maxTimeout = 2000U; // ~10s for PTY which can be slower to respond depending on SDR startup + } + while (!m_setup->m_hasFetchedStatus) { m_setup->m_modem->clock(0U); timeout++; - if (timeout >= 75U) { + if (timeout >= maxTimeout) { break; }