Fix obvious AX25 TX data bug.

This commit is contained in:
Jonathan Naylor 2020-06-24 12:46:27 +01:00
parent 835ef46aef
commit a7ac55795d
1 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,7 @@ uint8_t CAX25TX::writeData(const uint8_t* data, uint16_t length)
uint8_t ones = 0U;
for (uint16_t i = 0U; i < (frame.m_length * 8U); i++) {
bool b1 = READ_BIT2(START_FLAG, i) != 0U;
bool b1 = READ_BIT2(frame.m_data, i) != 0U;
bool b2 = NRZI(b1);
WRITE_BIT1(m_poBuffer, m_poLen, b2);
m_poLen++;
@ -113,6 +113,7 @@ uint8_t CAX25TX::writeData(const uint8_t* data, uint16_t length)
if (b1) {
ones++;
if (ones == AX25_MAX_ONES) {
// Bit stuffing
bool b = NRZI(false);
WRITE_BIT1(m_poBuffer, m_poLen, b);
m_poLen++;