From 6f1af25695a51910d2bb8ca0e796a7edda028848 Mon Sep 17 00:00:00 2001 From: Jean-Claude Wippler Date: Sat, 9 Apr 2016 00:39:04 +0200 Subject: [PATCH] add John O's trick to sync on an extra AA from the preamble this change also sends out one more 0xAA preamble byte --- RF69.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RF69.cpp b/RF69.cpp index ccbb8aa8..56c6e5fe 100644 --- a/RF69.cpp +++ b/RF69.cpp @@ -13,6 +13,7 @@ #define REG_SYNCCONFIG 0x2E #define REG_SYNCVALUE1 0x2F #define REG_SYNCVALUE2 0x30 +#define REG_SYNCVALUE3 0x31 #define REG_NODEADRS 0x39 #define REG_PACKETCONFIG2 0x3D #define REG_AESKEY1 0x3E @@ -68,9 +69,10 @@ static ROM_UINT8 configRegs_compat [] ROM_DATA = { 0x1E, 0x2C, // FeiStart, AfcAutoclearOn, AfcAutoOn 0x25, 0x80, // DioMapping1 = SyncAddress (Rx) // 0x29, 0xDC, // RssiThresh ... - 0x2E, 0x88, // SyncConfig = sync on, sync size = 2 - 0x2F, 0x2D, // SyncValue1 = 0x2D - // 0x30, 0x05, // SyncValue2 = 0x05 + 0x2E, 0x90, // SyncConfig = sync on, sync size = 3 + 0x2F, 0xAA, // SyncValue1 = 0xAA + 0x30, 0x2D, // SyncValue2 = 0x2D + // 0x31, 0x05, // SyncValue3 = 0x05 0x37, 0x00, // PacketConfig1 = fixed, no crc, filt off 0x38, 0x00, // PayloadLength = 0, unlimited 0x3C, 0x8F, // FifoTresh, not empty, level 15 @@ -154,7 +156,7 @@ void RF69::configure_compat () { initRadio(configRegs_compat); // FIXME doesn't seem to work, nothing comes in but noise for group 0 // writeReg(REG_SYNCCONFIG, group ? 0x88 : 0x80); - writeReg(REG_SYNCVALUE2, group); + writeReg(REG_SYNCVALUE3, group); writeReg(REG_FRFMSB, frf >> 16); writeReg(REG_FRFMSB+1, frf >> 8);