mirror of
https://github.com/g4klx/MMDVM_HS.git
synced 2025-12-06 07:02:00 +01:00
Update the M17 sync vectors.
This commit is contained in:
parent
c9bd700100
commit
6c4f2041cb
10
M17Defines.h
10
M17Defines.h
|
|
@ -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 unsigned int M17_SYNC_LENGTH_BITS = 16U;
|
||||||
|
|
||||||
const uint8_t M17_HEADER_SYNC_BYTES[] = {0x5DU, 0xDDU};
|
const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U};
|
||||||
const uint8_t M17_DATA_SYNC_BYTES[] = {0xDDU, 0xDDU};
|
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 uint8_t M17_SYNC_BYTES_LENGTH = 2U;
|
||||||
|
|
||||||
const uint16_t M17_HEADER_SYNC_BITS = 0x5DDDU;
|
const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U;
|
||||||
const uint16_t M17_DATA_SYNC_BITS = 0xDDDDU;
|
const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU;
|
||||||
|
const uint16_t M17_PACKET_SYNC_BITS = 0x75FFU;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
12
M17RX.cpp
12
M17RX.cpp
|
|
@ -72,10 +72,10 @@ void CM17RX::processNone(bool bit)
|
||||||
m_bitBuffer |= 0x01U;
|
m_bitBuffer |= 0x01U;
|
||||||
|
|
||||||
// Fuzzy matching of the header sync bit sequence
|
// 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");
|
DEBUG1("M17RX: header sync found in None");
|
||||||
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
|
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_lostCount = MAX_SYNC_FRAMES;
|
||||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||||
|
|
@ -85,10 +85,10 @@ void CM17RX::processNone(bool bit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fuzzy matching of the data sync bit sequence
|
// 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");
|
DEBUG1("M17RX: data sync found in None");
|
||||||
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
|
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_lostCount = MAX_SYNC_FRAMES;
|
||||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
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
|
// 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)) {
|
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) {
|
||||||
// Fuzzy matching of the data sync bit sequence
|
// 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);
|
DEBUG2("M17RX: found header sync in Data, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
|
||||||
m_lostCount = MAX_SYNC_FRAMES;
|
m_lostCount = MAX_SYNC_FRAMES;
|
||||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
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
|
// 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)) {
|
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 2U)) {
|
||||||
// Fuzzy matching of the data sync bit sequence
|
// 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);
|
DEBUG2("M17RX: found data sync in Data, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
|
||||||
m_lostCount = MAX_SYNC_FRAMES;
|
m_lostCount = MAX_SYNC_FRAMES;
|
||||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,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 "20201126"
|
#define VERSION_DATE "20201226"
|
||||||
|
|
||||||
#if defined(ZUMSPOT_ADF7021)
|
#if defined(ZUMSPOT_ADF7021)
|
||||||
#define BOARD_INFO "ZUMspot"
|
#define BOARD_INFO "ZUMspot"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue