From 7444c44b48f7d60928956d05a0cbd0709135e883 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sat, 13 Apr 2024 10:22:39 +0200 Subject: [PATCH] SLT try 1b --- Multiprotocol/XN297Dump_nrf24l01.ino | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Multiprotocol/XN297Dump_nrf24l01.ino b/Multiprotocol/XN297Dump_nrf24l01.ino index e82bc878b..e3aa3c47e 100644 --- a/Multiprotocol/XN297Dump_nrf24l01.ino +++ b/Multiprotocol/XN297Dump_nrf24l01.ino @@ -37,6 +37,7 @@ boolean enhanced; boolean ack; uint8_t pid; uint8_t bitrate; +uint8_t old_option; static void __attribute__((unused)) XN297Dump_RF_init() { @@ -610,8 +611,7 @@ static uint16_t XN297Dump_callback() if(phase==0) { address_length=4; - memcpy(rx_tx_addr, (uint8_t *)"\x7E\xB8\x63\xA9", address_length); - + memcpy(rx_tx_addr, (uint8_t *)"\xF4\x71\x8D\x01", address_length); // bind \x7E\xB8\x63\xA9 bitrate=XN297DUMP_250K; packet_length=16; hopping_frequency_no=0x50; //bind 0x50, normal ?? @@ -623,7 +623,8 @@ static uint16_t XN297Dump_callback() NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rx_tx_addr, address_length); // set up RX address NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, packet_length); // Enable rx pipe 0 NRF24L01_WriteReg(NRF24L01_05_RF_CH, option); //hopping_frequency_no); - + old_option = option; + debug("NRF dump, len=%d, rf=%d, address length=%d, bitrate=",packet_length,option,address_length); //hopping_frequency_no,address_length); switch(bitrate) { @@ -718,7 +719,11 @@ static uint16_t XN297Dump_callback() NRF24L01_FlushRx(); NRF24L01_WriteReg(NRF24L01_00_CONFIG, _BV(NRF24L01_00_PWR_UP) | _BV(NRF24L01_00_PRIM_RX)); // _BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | } - NRF24L01_WriteReg(NRF24L01_05_RF_CH, option); //hopping_frequency_no); + if(old_option != option) + { + NRF24L01_WriteReg(NRF24L01_05_RF_CH, option); //hopping_frequency_no); + old_option = option; + } } } else if(sub_protocol == XN297DUMP_CC2500)