From a7ac55795d3535f3fc6c58970c650bb02a8a5655 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Wed, 24 Jun 2020 12:46:27 +0100 Subject: [PATCH] Fix obvious AX25 TX data bug. --- AX25TX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AX25TX.cpp b/AX25TX.cpp index 8658fb4..5652bd8 100644 --- a/AX25TX.cpp +++ b/AX25TX.cpp @@ -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++;