Roll back some of recent changes.

This commit is contained in:
Jonathan Naylor 2021-09-12 20:59:59 +01:00
parent d9621c5c8b
commit 6fc189793d
4 changed files with 18 additions and 10 deletions

View file

@ -29,13 +29,13 @@ const unsigned int M17_SYNC_LENGTH_BYTES = M17_SYNC_LENGTH_BITS / 8U;
const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U}; const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U};
const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU}; const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU};
const uint8_t M17_EOF_SYNC_BYTES[] = {0x55U, 0x5DU}; const uint8_t M17_EOT_SYNC_BYTES[] = {0x55U, 0x5DU};
const uint8_t M17_SYNC_BYTES_LENGTH = 2U; const uint8_t M17_SYNC_BYTES_LENGTH = 2U;
const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U; const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U;
const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU; const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU;
const uint16_t M17_EOF_SYNC_BITS = 0x555DU; const uint16_t M17_EOT_SYNC_BITS = 0x555DU;
#endif #endif

View file

@ -110,6 +110,14 @@ void CM17RX::processData(bool bit)
// Only search for the syncs in the right place +-2 symbols // Only search for the syncs in the right place +-2 symbols
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) { if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) {
// Fuzzy matching of the link setup sync bit sequence
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found link setup sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
m_state = M17RXS_LINK_SETUP;
}
// Fuzzy matching of the stream sync bit sequence // Fuzzy matching of the stream sync bit sequence
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) { if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found stream sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS); DEBUG2("M17RX: found stream sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
@ -118,12 +126,13 @@ void CM17RX::processData(bool bit)
m_state = M17RXS_STREAM; m_state = M17RXS_STREAM;
} }
// Fuzzy matching of the eof sync bit sequence // Fuzzy matching of the EOT sync bit sequence
if (countBits16(m_bitBuffer ^ M17_EOF_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) { if (countBits16(m_bitBuffer ^ M17_EOT_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found eof sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS); DEBUG2("M17RX: found eot sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
io.setDecode(false); io.setDecode(false);
serial.writeM17EOT(); serial.writeM17EOT();
reset(); reset();
return;
} }
} }
@ -138,8 +147,7 @@ void CM17RX::processData(bool bit)
reset(); reset();
} else { } else {
// Write data to host // Write data to host
m_outBuffer[0U] = 0x00U; // Stream data m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
m_outBuffer[0U] |= m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
switch (m_state) { switch (m_state) {
case M17RXS_LINK_SETUP: case M17RXS_LINK_SETUP:

View file

@ -116,11 +116,11 @@ uint8_t CM17TX::writeEOT()
{ {
/* /*
uint16_t space = m_buffer.getSpace(); uint16_t space = m_buffer.getSpace();
if (space < M17_SYNC_LENGTH_BYTES) if (space < M17_FRAME_LENGTH_BYTES)
return 5U; return 5U;
for (uint8_t i = 0U; i < M17_SYNC_LENGTH_BYTES; i++) for (uint8_t i = 0U; i < M17_SYNC_LENGTH_BYTES; i++)
m_buffer.put(M17_EOF_SYNC_BYTES[i]); m_buffer.put(M17_EOT_SYNC_BYTES[i]);
*/ */
return 0U; return 0U;
} }

View file

@ -26,7 +26,7 @@
#define VER_MAJOR "1" #define VER_MAJOR "1"
#define VER_MINOR "5" #define VER_MINOR "5"
#define VER_REV "2" #define VER_REV "2"
#define VERSION_DATE "20210908" #define VERSION_DATE "20210912"
#if defined(ZUMSPOT_ADF7021) #if defined(ZUMSPOT_ADF7021)
#define BOARD_INFO "ZUMspot" #define BOARD_INFO "ZUMspot"