From f10fe7bbf011f125692a2411ba2ab61efdecce16 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 22 Sep 2026 11:48:21 -0400 Subject: [PATCH] AFHS2A: 14/17 channels Switch based on RX number --- Multiprotocol/AFHDS2A_a7105.ino | 18 ++++++++++++------ Multiprotocol/Multiprotocol.h | 2 +- Protocols_Details.md | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Multiprotocol/AFHDS2A_a7105.ino b/Multiprotocol/AFHDS2A_a7105.ino index 548290aa..99e7aa0a 100644 --- a/Multiprotocol/AFHDS2A_a7105.ino +++ b/Multiprotocol/AFHDS2A_a7105.ino @@ -183,16 +183,22 @@ static void AFHDS2A_build_bind_packet() static void AFHDS2A_build_packet(uint8_t type) { uint16_t val; + uint8_t num_ch = 14; //14 channels + if(RX_num > 31) + num_ch = 17; //16 channels memcpy( &packet[1], rx_tx_addr, 4); memcpy( &packet[5], rx_id, 4); switch(type) { case AFHDS2A_PACKET_STICKS: packet[0] = 0x58; - //16 channels + RX_LQI on channel 17 - for(uint8_t ch=0; ch<17; ch++) + for(uint8_t ch=0; ch>4)&0xF0; @@ -215,7 +219,9 @@ static void AFHDS2A_build_packet(uint8_t type) break; case AFHDS2A_PACKET_FAILSAFE: packet[0] = 0x56; - for(uint8_t ch=0; ch<16; ch++) + if(num_ch == 17) + num_ch--; + for(uint8_t ch=0; ch