Skip to content

Commit

Permalink
XK2: 1 TX ID but multiple RX IDs?
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed Jul 12, 2024
1 parent 8685fca commit b8c5929
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Multiprotocol/Multiprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 4
#define VERSION_PATCH_LEVEL 10
#define VERSION_PATCH_LEVEL 11

#define MODE_SERIAL 0

Expand Down Expand Up @@ -842,7 +842,8 @@ enum {
#define MOULDKG_EEPROM_OFFSET 882 // RX ID, 3 bytes per model, end is 882+64*3=1074
#define DSM_CLONE_EEPROM_OFFSET 1074 // (4) TX ID, (1) Initialized, end is 1079
#define TRAXXAS_EEPROM_OFFSET 1079 // RX ID and SOP index, 3 bytes per model id, end is 1079+192=1271
//#define CONFIG_EEPROM_OFFSET 1271 // Current configuration of the multimodule
#define XK2_EEPROM_OFFSET 1271 // RX ID checksum, 1 byte per model, end is 1271+64=1335
//#define CONFIG_EEPROM_OFFSET 1335 // Current configuration of the multimodule

/* STM32 Flash Size */
#ifndef DISABLE_FLASH_SIZE_CHECK
Expand Down
13 changes: 10 additions & 3 deletions Multiprotocol/XK2_ccnrf.ino
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void __attribute__((unused)) XK2_send_packet()
//Telemetry not received=00, Telemetry received=01 but sometimes switch to 1 even if telemetry is not there...
packet[6] = 0x00;
//Unknown
packet[7] = 0x5A; //Constant?
packet[7] = crc8; //?? RX_ID checksum ?? => sum RX_ID[0..2]
//Checksum seed
packet[8] = 0x7F; //Constant?
}
Expand Down Expand Up @@ -152,18 +152,25 @@ uint16_t XK2_callback()
phase++;
else
{
//checksum of RX_ID
crc8 = packet[4] + packet[5] + packet[6];
debugln("W:RX_ID=%02X",crc8);
eeprom_write_byte((EE_ADDR)(XK2_EEPROM_OFFSET+RX_num),crc8);
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(TX_EN);
bind_counter = 10;
bind_counter = 10; //send 10 bind end packets
phase = XK2_DATA;
}
}
return 1000;
case XK2_DATA_PREP:
crc8=eeprom_read_byte((EE_ADDR)(XK2_EEPROM_OFFSET+RX_num));
debugln("R:RX_ID=%02X",crc8);
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(TX_EN);
XN297_SetTXAddr(rx_tx_addr, 5);
BIND_DONE;
phase++;
case XK2_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(XK2_PACKET_PERIOD);
Expand Down Expand Up @@ -267,7 +274,7 @@ P[5] = flags
08=6g/3d=short_press_right sequece also switches for a few packets to C1 if 8 C0 if 0
P[6] = 00 telemetry nok
01 telemetry ok but sometimes switch to 1 also when telemetry is nok...
P[7] = 5A
P[7] = 5A -> ?? RX_ID checksum ?? => sum RX_ID[0..2]
P[8] = sum P[0..7] + 7F
Telemetry
Expand Down

0 comments on commit b8c5929

Please sign in to comment.