From 9a3d00abd0438a991dceb837747278280036907f Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sun, 30 Oct 2022 12:44:51 -0400 Subject: [PATCH] remove playback timer (its unused now); fix some issues with the way interrupt P25 CC was working; --- host/Host.cpp | 21 ++++++--------------- host/calibrate/HostCal.cpp | 2 +- modem/Modem.cpp | 3 +-- modem/Modem.h | 2 +- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/host/Host.cpp b/host/Host.cpp index e5a52cbb..518b848a 100644 --- a/host/Host.cpp +++ b/host/Host.cpp @@ -815,6 +815,7 @@ int Host::run() // Macro to interrupt a running P25 control channel transmission #define INTERRUPT_P25_CONTROL \ if (p25 != nullptr) { \ + LogDebug(LOG_HOST, "interrupt P25 control, m_state = %u", m_state); \ p25->setCCHalted(true); \ if (p25BcastDurationTimer.isRunning() && !p25BcastDurationTimer.isPaused()) { \ p25BcastDurationTimer.pause(); \ @@ -826,6 +827,7 @@ int Host::run() if (dmr != nullptr) { \ if (dmrBeaconDurationTimer.isRunning() && !dmrBeaconDurationTimer.hasExpired()) { \ if (m_dmrTSCCData && !m_dmrCtrlChannel) { \ + LogDebug(LOG_HOST, "interrupt DMR control, m_state = %u", m_state); \ dmr->setCCHalted(true); \ dmr->setCCRunning(false); \ } \ @@ -836,6 +838,7 @@ int Host::run() // Macro to interrupt a running NXDN control channel transmission #define INTERRUPT_NXDN_CONTROL \ if (nxdn != nullptr) { \ + LogDebug(LOG_HOST, "interrupt NXDN control, m_state = %u", m_state); \ nxdn->setCCHalted(true); \ if (nxdnBcastDurationTimer.isRunning() && !nxdnBcastDurationTimer.isPaused()) { \ nxdnBcastDurationTimer.pause(); \ @@ -928,7 +931,6 @@ int Host::run() // if there is a P25 CC running; halt the CC if (p25 != nullptr) { if (p25->getCCRunning() && !p25->getCCHalted()) { - p25->setCCHalted(true); INTERRUPT_P25_CONTROL; } } @@ -936,7 +938,6 @@ int Host::run() // if there is a NXDN CC running; halt the CC if (nxdn != nullptr) { if (nxdn->getCCRunning() && !nxdn->getCCHalted()) { - nxdn->setCCHalted(true); INTERRUPT_NXDN_CONTROL; } } @@ -975,7 +976,6 @@ int Host::run() // if there is a P25 CC running; halt the CC if (p25 != nullptr) { if (p25->getCCRunning() && !p25->getCCHalted()) { - p25->setCCHalted(true); INTERRUPT_P25_CONTROL; } } @@ -983,7 +983,6 @@ int Host::run() // if there is a NXDN CC running; halt the CC if (nxdn != nullptr) { if (nxdn->getCCRunning() && !nxdn->getCCHalted()) { - nxdn->setCCHalted(true); INTERRUPT_NXDN_CONTROL; } } @@ -1022,7 +1021,6 @@ int Host::run() // if there is a NXDN CC running; halt the CC if (nxdn != nullptr) { if (nxdn->getCCRunning() && !nxdn->getCCHalted()) { - nxdn->setCCHalted(true); INTERRUPT_NXDN_CONTROL; } } @@ -1097,7 +1095,6 @@ int Host::run() // if there is a P25 CC running; halt the CC if (p25 != nullptr) { if (p25->getCCRunning() && !p25->getCCHalted()) { - p25->setCCHalted(true); INTERRUPT_P25_CONTROL; } } @@ -1263,7 +1260,7 @@ int Host::run() setState(STATE_P25); INTERRUPT_DMR_BEACON; - INTERRUPT_P25_CONTROL; + //INTERRUPT_P25_CONTROL; INTERRUPT_NXDN_CONTROL; } else { @@ -1306,7 +1303,7 @@ int Host::run() bool ret = p25->processFrame(data, len); if (ret) { m_modeTimer.start(); - INTERRUPT_P25_CONTROL; + //INTERRUPT_P25_CONTROL; } else { ret = p25->writeRF_VoiceEnd(); @@ -2049,17 +2046,12 @@ bool Host::createModem() if (!modemConf["txLevel"].isNone()) { cwIdTXLevel = dmrTXLevel = p25TXLevel = nxdnTXLevel = modemConf["txLevel"].as(50.0F); } - uint8_t packetPlayoutTime = (uint8_t)modemConf["packetPlayoutTime"].as(10U); bool disableOFlowReset = modemConf["disableOFlowReset"].as(false); bool ignoreModemConfigArea = modemConf["ignoreModemConfigArea"].as(false); bool dumpModemStatus = modemConf["dumpModemStatus"].as(false); bool trace = modemConf["trace"].as(false); bool debug = modemConf["debug"].as(false); - // make sure playout time is always greater than 1ms - if (packetPlayoutTime < 1U) - packetPlayoutTime = 1U; - if (rfPower == 0U) { // clamp to 1 rfPower = 1U; } @@ -2175,7 +2167,6 @@ bool Host::createModem() LogInfo(" DMR TX Level: %.1f%%", dmrTXLevel); LogInfo(" P25 TX Level: %.1f%%", p25TXLevel); LogInfo(" NXDN TX Level: %.1f%%", nxdnTXLevel); - LogInfo(" Packet Playout Time: %u ms", packetPlayoutTime); LogInfo(" Disable Overflow Reset: %s", disableOFlowReset ? "yes" : "no"); if (m_useDFSI) { @@ -2196,7 +2187,7 @@ bool Host::createModem() } m_modem = new Modem(modemPort, m_duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, - packetPlayoutTime, disableOFlowReset, ignoreModemConfigArea, dumpModemStatus, trace, debug); + disableOFlowReset, ignoreModemConfigArea, dumpModemStatus, trace, debug); if (!m_modemRemote) { m_modem->setModeParams(m_dmrEnabled, m_p25Enabled, m_nxdnEnabled); m_modem->setLevels(rxLevel, cwIdTXLevel, dmrTXLevel, p25TXLevel, nxdnTXLevel); diff --git a/host/calibrate/HostCal.cpp b/host/calibrate/HostCal.cpp index 2369c87d..8279c293 100644 --- a/host/calibrate/HostCal.cpp +++ b/host/calibrate/HostCal.cpp @@ -421,7 +421,7 @@ int HostCal::run() p25::lc::TSBK::setWarnCRC(true); p25::lc::tsbk::TSBKFactory::setWarnCRC(true); - m_modem = new Modem(modemPort, false, rxInvert, txInvert, pttInvert, dcBlocker, false, fdmaPreamble, dmrRxDelay, p25CorrCount, 10U, false, ignoreModemConfigArea, false, false, false); + m_modem = new Modem(modemPort, false, rxInvert, txInvert, pttInvert, dcBlocker, false, fdmaPreamble, dmrRxDelay, p25CorrCount, false, ignoreModemConfigArea, false, false, false); m_modem->setLevels(rxLevel, txLevel, txLevel, txLevel, txLevel); m_modem->setSymbolAdjust(dmrSymLevel3Adj, dmrSymLevel1Adj, p25SymLevel3Adj, p25SymLevel1Adj, nxdnSymLevel3Adj, nxdnSymLevel1Adj); m_modem->setDCOffsetParams(txDCOffset, rxDCOffset); diff --git a/modem/Modem.cpp b/modem/Modem.cpp index e2c43aae..33d686aa 100644 --- a/modem/Modem.cpp +++ b/modem/Modem.cpp @@ -105,14 +105,13 @@ using namespace modem; /// Count of FDMA preambles to transmit before data. (P25/DMR DMO) /// Compensate for delay in receiver audio chain in ms. Usually DSP based. /// P25 Correlation Countdown. -/// Length of time in MS between packets to send to modem. /// Flag indicating whether the ADC/DAC overflow reset logic is disabled. /// Flag indicating whether the modem configuration area is ignored. /// Flag indicating whether the modem status is dumped to the log. /// Flag indicating whether air interface modem trace is enabled. /// Flag indicating whether air interface modem debug is enabled. Modem::Modem(port::IModemPort* port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, bool cosLockout, - uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, + uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, bool disableOFlowReset, bool ignoreModemConfigArea, bool dumpModemStatus, bool trace, bool debug) : m_port(port), m_protoVer(0U), diff --git a/modem/Modem.h b/modem/Modem.h index d00b561e..2fd27c95 100644 --- a/modem/Modem.h +++ b/modem/Modem.h @@ -217,7 +217,7 @@ namespace modem public: /// Initializes a new instance of the Modem class. Modem(port::IModemPort* port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, bool cosLockout, - uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, + uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, bool disableOFlowReset, bool ignoreModemConfigArea, bool dumpModemStatus, bool trace, bool debug); /// Finalizes a instance of the Modem class. ~Modem();