mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 18:38:13 +00:00
XN297Dump fix CRC...
This commit is contained in:
parent
ccdf60d525
commit
c3a5c263d3
@ -19,7 +19,7 @@
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_REVISION 1
|
#define VERSION_REVISION 1
|
||||||
#define VERSION_PATCH_LEVEL 48
|
#define VERSION_PATCH_LEVEL 49
|
||||||
|
|
||||||
//******************
|
//******************
|
||||||
// Protocols
|
// Protocols
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "iface_nrf24l01.h"
|
#include "iface_nrf24l01.h"
|
||||||
|
|
||||||
// Parameters which can be modified
|
// Parameters which can be modified
|
||||||
#define XN297DUMP_PERIOD_DUMP 2000 // Multiplied by 50, default 2000=100ms
|
#define XN297DUMP_PERIOD_DUMP 3000 // Multiplied by 50, default 3000=150ms
|
||||||
#define XN297DUMP_MAX_RF_CHANNEL 84 // Default 84
|
#define XN297DUMP_MAX_RF_CHANNEL 84 // Default 84
|
||||||
|
|
||||||
// Do not touch from there
|
// Do not touch from there
|
||||||
@ -72,7 +72,7 @@ static boolean __attribute__((unused)) XN297Dump_process_packet(void)
|
|||||||
uint8_t packet_ori[XN297DUMP_MAX_PACKET_LEN];
|
uint8_t packet_ori[XN297DUMP_MAX_PACKET_LEN];
|
||||||
memcpy(packet_ori,packet,XN297DUMP_MAX_PACKET_LEN);
|
memcpy(packet_ori,packet,XN297DUMP_MAX_PACKET_LEN);
|
||||||
address_length=5;
|
address_length=5;
|
||||||
|
|
||||||
while(address_length >= 3)
|
while(address_length >= 3)
|
||||||
{
|
{
|
||||||
// init crc
|
// init crc
|
||||||
@ -99,9 +99,9 @@ static boolean __attribute__((unused)) XN297Dump_process_packet(void)
|
|||||||
packet[i] = bit_reverse(packet[i]);
|
packet[i] = bit_reverse(packet[i]);
|
||||||
// check crc
|
// check crc
|
||||||
if (RX_num)
|
if (RX_num)
|
||||||
crcxored = crc ^ pgm_read_word(&xn297_crc_xorout[i - 3]);
|
crcxored = crc ^ pgm_read_word(&xn297_crc_xorout[i+1 - 3]);
|
||||||
else
|
else
|
||||||
crcxored = crc ^ pgm_read_word(&xn297_crc_xorout_scrambled[i - 3]);
|
crcxored = crc ^ pgm_read_word(&xn297_crc_xorout_scrambled[i+1 - 3]);
|
||||||
if( (crcxored >> 8) == packet[i + 1] && (crcxored & 0xff) == packet[i + 2])
|
if( (crcxored >> 8) == packet[i + 1] && (crcxored & 0xff) == packet[i + 2])
|
||||||
{
|
{
|
||||||
packet_length=i+1;
|
packet_length=i+1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user