Skip to content

Commit b31bbfa

Browse files
author
Pascal Langer
committed
JJRC345: Change checksum calculation
1 parent 48e4cad commit b31bbfa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Multiprotocol/JJRC345_nrf24l01.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void __attribute__((unused)) JJRC345_send_packet()
9090

9191
packet[12] = 0x02; // Rate: 00-01-02
9292
}
93-
packet[3] = (packet[4] >= 0xB7) ? 0x0e : 0x0a; // Some throttle flag. 0A when Thr <= B6, 0E when Thr >= B7, sometimes 06 when moving Ele/Ail
93+
packet[3] = (packet[4] >= 0xB7) ? 0x0e : 0x0a; // Some flag or check... 0A when Thr <= B6, 0E when Thr >= B7, sometimes 06 when moving Ele/Ail
9494

9595
packet[8] = 0x00 // Rudder trim, 00 when not used, 01..1F when trimmed left, 20..3F
9696
| GET_FLAG(CH6_SW,JJRC345_FLAG_HEADLESS) // Headless mode: 00 normal, 40 headless
@@ -101,7 +101,7 @@ static void __attribute__((unused)) JJRC345_send_packet()
101101
packet[11] = hopping_frequency[0]; // First hopping frequency
102102

103103
// Checksum
104-
packet[13] = 0xf8;
104+
packet[13] = 0x02-packet[3];
105105
for (uint8_t i = 0; i < 13; i++)
106106
{
107107
debug(" %02X", packet[i]);

0 commit comments

Comments
 (0)