Small CW Id cleanups.

This commit is contained in:
Jonathan Naylor 2016-05-10 06:35:53 +01:00
parent 61cacc40b9
commit 90ff130c51
3 changed files with 21 additions and 4 deletions

View file

@ -140,7 +140,7 @@ uint8_t CCWIdTX::write(const uint8_t* data, uint8_t length)
bool b = (SYMBOL_LIST[j].pattern & MASK) == MASK;
WRITE_BIT1(m_poBuffer, m_poLen, b);
if (m_poLen >= 1000U) {
if (m_poLen >= 995U) {
m_poLen = 0U;
return 4U;
}
@ -151,13 +151,23 @@ uint8_t CCWIdTX::write(const uint8_t* data, uint8_t length)
}
}
if (m_poLen == 8U)
// An empty message
if (m_poLen == 8U) {
m_poLen = 0U;
else
m_poLen += 5U;
return 4U;
}
m_poLen += 5U;
DEBUG2("Message created with length", m_poLen);
return 0U;
}
void CCWIdTX::reset()
{
m_poLen = 0U;
m_poPtr = 0U;
m_n = 0U;
}