Flysky AFHDS2A: 16 channels + LQI

Use the 2 new sub protocols to extend the protocol to 16 channels on IBUS
This commit is contained in:
Pascal Langer
2020-07-15 23:58:41 +02:00
parent f8ac406a94
commit d6da230369
8 changed files with 97 additions and 53 deletions

View File

@@ -39,7 +39,7 @@ static void __attribute__((unused)) AFHDS2A_Rx_build_telemetry_packet()
packet_in[idx++] = 14; // number of channels in packet
// pack channels
for (uint8_t i = 0; i < 14; i++) {
uint32_t val = packet[9+i*2] | (packet[10+i*2] << 8);
uint32_t val = packet[9+i*2] | ((packet[10+i*2] << 8)&0x0F);
if (val < 860)
val = 860;
// convert ppm (860-2140) to Multi (0-2047)