Update the M17 sync vectors.

This commit is contained in:
Jonathan Naylor 2020-12-26 12:51:35 +00:00
parent c9bd700100
commit 6c4f2041cb
3 changed files with 13 additions and 11 deletions

View file

@ -26,13 +26,15 @@ const unsigned int M17_FRAME_LENGTH_BYTES = M17_FRAME_LENGTH_BITS / 8U;
const unsigned int M17_SYNC_LENGTH_BITS = 16U;
const uint8_t M17_HEADER_SYNC_BYTES[] = {0x5DU, 0xDDU};
const uint8_t M17_DATA_SYNC_BYTES[] = {0xDDU, 0xDDU};
const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U};
const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU};
const uint8_t M17_PACKET_SYNC_BYTES[] = {0x75U, 0xFFU};
const uint8_t M17_SYNC_BYTES_LENGTH = 2U;
const uint16_t M17_HEADER_SYNC_BITS = 0x5DDDU;
const uint16_t M17_DATA_SYNC_BITS = 0xDDDDU;
const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U;
const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU;
const uint16_t M17_PACKET_SYNC_BITS = 0x75FFU;
#endif

View file

@ -72,10 +72,10 @@ void CM17RX::processNone(bool bit)
m_bitBuffer |= 0x01U;
// Fuzzy matching of the header sync bit sequence
if (countBits16(m_bitBuffer ^ M17_HEADER_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
DEBUG1("M17RX: header sync found in None");
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
m_buffer[i] = M17_HEADER_SYNC_BYTES[i];
m_buffer[i] = M17_LINK_SETUP_SYNC_BYTES[i];
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
@ -85,10 +85,10 @@ void CM17RX::processNone(bool bit)
}
// Fuzzy matching of the data sync bit sequence
if (countBits16(m_bitBuffer ^ M17_DATA_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
DEBUG1("M17RX: data sync found in None");
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
m_buffer[i] = M17_DATA_SYNC_BYTES[i];
m_buffer[i] = M17_STREAM_SYNC_BYTES[i];
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
@ -113,7 +113,7 @@ void CM17RX::processHeader(bool bit)
// Only search for a sync in the right place +-2 symbols
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) {
// Fuzzy matching of the data sync bit sequence
if (countBits16(m_bitBuffer ^ M17_HEADER_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found header sync in Data, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
@ -150,7 +150,7 @@ void CM17RX::processData(bool bit)
// Only search for a sync in the right place +-2 symbols
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) {
// Fuzzy matching of the data sync bit sequence
if (countBits16(m_bitBuffer ^ M17_DATA_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found data sync in Data, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;

View file

@ -25,7 +25,7 @@
#define VER_MAJOR "1"
#define VER_MINOR "5"
#define VER_REV "2"
#define VERSION_DATE "20201126"
#define VERSION_DATE "20201226"
#if defined(ZUMSPOT_ADF7021)
#define BOARD_INFO "ZUMspot"