From 7907ce69113d4ad9d67ac7b4fae252c27f8c6d8d Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 22 Mar 2016 06:36:47 +0000 Subject: [PATCH] Reset the sample count at the beginning of each transmission. --- DMRTX.cpp | 2 ++ DStarTX.cpp | 5 +++++ YSFTX.cpp | 2 ++ 3 files changed, 9 insertions(+) diff --git a/DMRTX.cpp b/DMRTX.cpp index 9f3142f..a3b9e7c 100644 --- a/DMRTX.cpp +++ b/DMRTX.cpp @@ -189,6 +189,8 @@ uint8_t CDMRTX::writeShortLC(const uint8_t* data, uint8_t length) void CDMRTX::setStart(bool start) { m_state = start ? DMRTXSTATE_SLOT1 : DMRTXSTATE_IDLE; + + m_count = 0U; } void CDMRTX::writeByte(uint8_t c, uint8_t control) diff --git a/DStarTX.cpp b/DStarTX.cpp index 236f333..1bbf95c 100644 --- a/DStarTX.cpp +++ b/DStarTX.cpp @@ -212,6 +212,8 @@ void CDStarTX::process() if (type == DSTAR_HEADER && m_poLen == 0U) { if (!m_tx) { + m_count = 0U; + for (uint16_t i = 0U; i < m_txDelay; i++) m_poBuffer[m_poLen++] = BIT_SYNC; } else { @@ -237,6 +239,9 @@ void CDStarTX::process() } if (type == DSTAR_DATA && m_poLen == 0U) { + if (!m_tx) + m_count = 0U; + // Pop the type byte off m_buffer.get(); diff --git a/YSFTX.cpp b/YSFTX.cpp index f72ab98..74bc398 100644 --- a/YSFTX.cpp +++ b/YSFTX.cpp @@ -61,6 +61,8 @@ void CYSFTX::process() if (m_poLen == 0U) { if (!m_tx) { + m_count = 0U; + for (uint16_t i = 0U; i < m_txDelay; i++) m_poBuffer[m_poLen++] = YSF_START_SYNC; } else {