Reset the sample count at the beginning of each transmission.

This commit is contained in:
Jonathan Naylor 2016-03-22 06:36:47 +00:00
parent 3665d02fe7
commit 7907ce6911
3 changed files with 9 additions and 0 deletions

View File

@ -189,6 +189,8 @@ uint8_t CDMRTX::writeShortLC(const uint8_t* data, uint8_t length)
void CDMRTX::setStart(bool start) void CDMRTX::setStart(bool start)
{ {
m_state = start ? DMRTXSTATE_SLOT1 : DMRTXSTATE_IDLE; m_state = start ? DMRTXSTATE_SLOT1 : DMRTXSTATE_IDLE;
m_count = 0U;
} }
void CDMRTX::writeByte(uint8_t c, uint8_t control) void CDMRTX::writeByte(uint8_t c, uint8_t control)

View File

@ -212,6 +212,8 @@ void CDStarTX::process()
if (type == DSTAR_HEADER && m_poLen == 0U) { if (type == DSTAR_HEADER && m_poLen == 0U) {
if (!m_tx) { if (!m_tx) {
m_count = 0U;
for (uint16_t i = 0U; i < m_txDelay; i++) for (uint16_t i = 0U; i < m_txDelay; i++)
m_poBuffer[m_poLen++] = BIT_SYNC; m_poBuffer[m_poLen++] = BIT_SYNC;
} else { } else {
@ -237,6 +239,9 @@ void CDStarTX::process()
} }
if (type == DSTAR_DATA && m_poLen == 0U) { if (type == DSTAR_DATA && m_poLen == 0U) {
if (!m_tx)
m_count = 0U;
// Pop the type byte off // Pop the type byte off
m_buffer.get(); m_buffer.get();

View File

@ -61,6 +61,8 @@ void CYSFTX::process()
if (m_poLen == 0U) { if (m_poLen == 0U) {
if (!m_tx) { if (!m_tx) {
m_count = 0U;
for (uint16_t i = 0U; i < m_txDelay; i++) for (uint16_t i = 0U; i < m_txDelay; i++)
m_poBuffer[m_poLen++] = YSF_START_SYNC; m_poBuffer[m_poLen++] = YSF_START_SYNC;
} else { } else {