diff --git a/ADF7021.cpp b/ADF7021.cpp index 1680329..5b2c912 100644 --- a/ADF7021.cpp +++ b/ADF7021.cpp @@ -559,7 +559,7 @@ void IO::rf2Conf(DVM_STATE modemState) AD7021_CONTROL = ADF7021_REG2; AD7021_2_IOCTL(); - DEBUG3("IO::rf2Conf(): ADF2 REG2 =", (ADF7021_REG2 >> 16 & 0xFFFFU), (ADF7021_REG3 & 0xFFFFU)); + DEBUG3("IO::rf2Conf() ADF2 REG2 =", (ADF7021_REG2 >> 16 & 0xFFFFU), (ADF7021_REG3 & 0xFFFFU)); /* ** Test DAC (Register 14) diff --git a/FirmwareMain.cpp b/FirmwareMain.cpp index 773491e..163a910 100644 --- a/FirmwareMain.cpp +++ b/FirmwareMain.cpp @@ -47,6 +47,7 @@ bool m_p25Enable = true; bool m_nxdnEnable = true; bool m_duplex = false; +bool m_forceDMO = false; bool m_tx = false; bool m_dcd = false; diff --git a/Globals.h b/Globals.h index ed41cb7..4ef2b9f 100644 --- a/Globals.h +++ b/Globals.h @@ -100,6 +100,7 @@ extern bool m_p25Enable; extern bool m_nxdnEnable; extern bool m_duplex; +extern bool m_forceDMO; extern bool m_tx; extern bool m_dcd; diff --git a/IO.cpp b/IO.cpp index 7b63719..7811e75 100644 --- a/IO.cpp +++ b/IO.cpp @@ -148,7 +148,7 @@ void IO::process() if (m_modemState == STATE_DMR) { /** Digital Mobile Radio */ #if defined(DUPLEX) - if (m_duplex) { + if (m_duplex && !m_forceDMO) { if (m_tx) dmrRX.databit(bit, control); else diff --git a/SerialPort.cpp b/SerialPort.cpp index ebbc428..0de1e5d 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -1010,6 +1010,7 @@ uint8_t SerialPort::setConfig(const uint8_t* data, uint8_t length) bool simplex = (data[0U] & 0x80U) == 0x80U; + m_forceDMO = (data[0U] & 0x40U) == 0x40U; m_debug = (data[0U] & 0x10U) == 0x10U; bool dmrEnable = (data[1U] & 0x02U) == 0x02U; diff --git a/dmr/CalDMR.cpp b/dmr/CalDMR.cpp index 79d9152..fbabc47 100644 --- a/dmr/CalDMR.cpp +++ b/dmr/CalDMR.cpp @@ -40,42 +40,42 @@ using namespace dmr; // Voice LC Header, CC: 1, srcID: 1, dstID: TG9 const uint8_t VH_1K[] = { 0x00U, - 0x00U, 0x20U, 0x08U, 0x08U, 0x02U, 0x38U, 0x15U, 0x00U, 0x2CU, 0xA0U, 0x14U, - 0x60U, 0x84U, 0x6DU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xDEU, 0x30U, 0x30U, - 0x01U, 0x10U, 0x01U, 0x40U, 0x03U, 0xC0U, 0x13U, 0xC1U, 0x1EU, 0x80U, 0x6FU }; + 0x00U, 0x20U, 0x08U, 0x08U, 0x02U, 0x38U, 0x15U, 0x00U, 0x2CU, 0xA0U, 0x14U, + 0x60U, 0x84U, 0x6DU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xDEU, 0x30U, 0x30U, + 0x01U, 0x10U, 0x01U, 0x40U, 0x03U, 0xC0U, 0x13U, 0xC1U, 0x1EU, 0x80U, 0x6FU }; // Voice Term with LC, CC: 1, srcID: 1, dstID: TG9 const uint8_t VT_1K[] = { 0x00U, - 0x00U, 0x4FU, 0x08U, 0xDCU, 0x02U, 0x88U, 0x15U, 0x78U, 0x2CU, 0xD0U, 0x14U, - 0xC0U, 0x84U, 0xADU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xD9U, 0x65U, 0x24U, - 0x02U, 0x28U, 0x06U, 0x20U, 0x0FU, 0x80U, 0x1BU, 0xC1U, 0x07U, 0x80U, 0x5CU }; + 0x00U, 0x4FU, 0x08U, 0xDCU, 0x02U, 0x88U, 0x15U, 0x78U, 0x2CU, 0xD0U, 0x14U, + 0xC0U, 0x84U, 0xADU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xD9U, 0x65U, 0x24U, + 0x02U, 0x28U, 0x06U, 0x20U, 0x0FU, 0x80U, 0x1BU, 0xC1U, 0x07U, 0x80U, 0x5CU }; // Voice LC MS Header, CC: 1, srcID: 1, dstID: TG9 const uint8_t VH_DMO1K[] = { 0x00U, - 0x00U, 0x20U, 0x08U, 0x08U, 0x02U, 0x38U, 0x15U, 0x00U, 0x2CU, 0xA0U, 0x14U, - 0x60U, 0x84U, 0x6DU, 0x5DU, 0x7FU, 0x77U, 0xFDU, 0x75U, 0x7EU, 0x30U, 0x30U, - 0x01U, 0x10U, 0x01U, 0x40U, 0x03U, 0xC0U, 0x13U, 0xC1U, 0x1EU, 0x80U, 0x6FU }; + 0x00U, 0x20U, 0x08U, 0x08U, 0x02U, 0x38U, 0x15U, 0x00U, 0x2CU, 0xA0U, 0x14U, + 0x60U, 0x84U, 0x6DU, 0x5DU, 0x7FU, 0x77U, 0xFDU, 0x75U, 0x7EU, 0x30U, 0x30U, + 0x01U, 0x10U, 0x01U, 0x40U, 0x03U, 0xC0U, 0x13U, 0xC1U, 0x1EU, 0x80U, 0x6FU }; // Voice Term MS with LC, CC: 1, srcID: 1, dstID: TG9 const uint8_t VT_DMO1K[] = { 0x00U, - 0x00U, 0x4FU, 0x08U, 0xDCU, 0x02U, 0x88U, 0x15U, 0x78U, 0x2CU, 0xD0U, 0x14U, - 0xC0U, 0x84U, 0xADU, 0x5DU, 0x7FU, 0x77U, 0xFDU, 0x75U, 0x79U, 0x65U, 0x24U, - 0x02U, 0x28U, 0x06U, 0x20U, 0x0FU, 0x80U, 0x1BU, 0xC1U, 0x07U, 0x80U, 0x5CU }; + 0x00U, 0x4FU, 0x08U, 0xDCU, 0x02U, 0x88U, 0x15U, 0x78U, 0x2CU, 0xD0U, 0x14U, + 0xC0U, 0x84U, 0xADU, 0x5DU, 0x7FU, 0x77U, 0xFDU, 0x75U, 0x79U, 0x65U, 0x24U, + 0x02U, 0x28U, 0x06U, 0x20U, 0x0FU, 0x80U, 0x1BU, 0xC1U, 0x07U, 0x80U, 0x5CU }; // Voice coding data + FEC, 1031 Hz Test Pattern const uint8_t VOICE_1K[] = { 0x00U, - 0xCEU, 0xA8U, 0xFEU, 0x83U, 0xACU, 0xC4U, 0x58U, 0x20U, 0x0AU, 0xCEU, 0xA8U, - 0xFEU, 0x83U, 0xA0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x58U, - 0x20U, 0x0AU, 0xCEU, 0xA8U, 0xFEU, 0x83U, 0xACU, 0xC4U, 0x58U, 0x20U, 0x0AU }; + 0xCEU, 0xA8U, 0xFEU, 0x83U, 0xACU, 0xC4U, 0x58U, 0x20U, 0x0AU, 0xCEU, 0xA8U, + 0xFEU, 0x83U, 0xA0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x58U, + 0x20U, 0x0AU, 0xCEU, 0xA8U, 0xFEU, 0x83U, 0xACU, 0xC4U, 0x58U, 0x20U, 0x0AU }; // Embedded LC: CC: 1, srcID: 1, dstID: TG9 const uint8_t SYNCEMB_1K[6][7] = { - { 0x07U, 0x55U, 0xFDU, 0x7DU, 0xF7U, 0x5FU, 0x70U }, // BS VOICE SYNC (audio seq 0) - { 0x01U, 0x30U, 0x00U, 0x00U, 0x90U, 0x09U, 0x10U }, // EMB + Embedded LC1 (audio seq 1) - { 0x01U, 0x70U, 0x00U, 0x90U, 0x00U, 0x07U, 0x40U }, // EMB + Embedded LC2 (audio seq 2) - { 0x01U, 0x70U, 0x00U, 0x31U, 0x40U, 0x07U, 0x40U }, // EMB + Embedded LC3 (audio seq 3) - { 0x01U, 0x50U, 0xA1U, 0x71U, 0xD1U, 0x70U, 0x70U }, // EMB + Embedded LC4 (audio seq 4) - { 0x01U, 0x10U, 0x00U, 0x00U, 0x00U, 0x0EU, 0x20U } }; // EMB (audio seq 5) + { 0x07U, 0x55U, 0xFDU, 0x7DU, 0xF7U, 0x5FU, 0x70U }, // BS VOICE SYNC (audio seq 0) + { 0x01U, 0x30U, 0x00U, 0x00U, 0x90U, 0x09U, 0x10U }, // EMB + Embedded LC1 (audio seq 1) + { 0x01U, 0x70U, 0x00U, 0x90U, 0x00U, 0x07U, 0x40U }, // EMB + Embedded LC2 (audio seq 2) + { 0x01U, 0x70U, 0x00U, 0x31U, 0x40U, 0x07U, 0x40U }, // EMB + Embedded LC3 (audio seq 3) + { 0x01U, 0x50U, 0xA1U, 0x71U, 0xD1U, 0x70U, 0x70U }, // EMB + Embedded LC4 (audio seq 4) + { 0x01U, 0x10U, 0x00U, 0x00U, 0x00U, 0x0EU, 0x20U } }; // EMB (audio seq 5) // Embedded LC MS: CC: 1, srcID: 1, dstID: TG9 const uint8_t SYNCEMB_DMO1K[6][7] = { diff --git a/dmr/DMRDMOTX.cpp b/dmr/DMRDMOTX.cpp index 187e69d..b7ed92c 100644 --- a/dmr/DMRDMOTX.cpp +++ b/dmr/DMRDMOTX.cpp @@ -138,9 +138,9 @@ void DMRDMOTX::setPreambleCount(uint8_t preambleCnt) uint32_t preambles = (uint32_t)((float)preambleCnt / 0.2083F); m_preambleCnt = DMRDMO_FIXED_DELAY + preambles; - // clamp preamble count to 250ms maximum - if (m_preambleCnt > 1200U) - m_preambleCnt = 1200U; + // clamp preamble count to 16ms maximum + if (m_preambleCnt > 80U) + m_preambleCnt = 80U; } /// diff --git a/nxdn/NXDNTX.cpp b/nxdn/NXDNTX.cpp index d7302ee..8d9865d 100644 --- a/nxdn/NXDNTX.cpp +++ b/nxdn/NXDNTX.cpp @@ -151,8 +151,9 @@ void NXDNTX::setPreambleCount(uint8_t preambleCnt) { m_preambleCnt = 300U + uint16_t(preambleCnt) * 6U; // 500ms + tx delay - if (m_preambleCnt > 1200U) - m_preambleCnt = 1200U; + // clamp preamble count + if (m_preambleCnt > 60U) + m_preambleCnt = 60U; } ///