Compute xn297 whitening instead of using an hardcoded array (#1201)

* Compute xn297 whitening instead of using an hardcoded array

* Add function to scramble byte for XN297 interface

* Refactor XN297 scrambling logic to use a global LFSR and improve byte generation

* Add technical specification and implementation details for XN297 whitening and CRC
This commit is contained in:
goebish
2026-10-25 16:57:07 +01:00
committed by GitHub
parent d3293afdab
commit 91199e146e
4 changed files with 587 additions and 108 deletions
+4 -2
View File
@@ -70,12 +70,14 @@ static void __attribute__((unused)) XN297Dump_RF_init()
}
}
extern const uint8_t xn297_scramble[];
static boolean __attribute__((unused)) XN297Dump_process_packet(void)
{
uint16_t crcxored;
uint8_t packet_sc[XN297DUMP_MAX_PACKET_LEN], packet_un[XN297DUMP_MAX_PACKET_LEN];
uint8_t xn297_scramble[XN297DUMP_MAX_PACKET_LEN];
xn297_lfsr = XN297_SCRAMBLE_SEED;
for (uint8_t i = 0; i < XN297DUMP_MAX_PACKET_LEN; i++)
xn297_scramble[i] = XN297_scramble_byte();
enhanced=false;
// init crc
crc = 0xb5d2;