Flysky/CX20 reversed elevator channel

This commit is contained in:
pascallanger
2016-12-02 20:28:42 +01:00
parent d6b4437664
commit c24f7a86d4
2 changed files with 7 additions and 8 deletions

View File

@@ -144,8 +144,11 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
packet[4] = rx_tx_addr[0];
for(i = 0; i < 8; i++)
{
packet[5 + i*2]=Servo_data[CH_AETR[i]]&0xFF; //low byte of servo timing(1000-2000us)
packet[6 + i*2]=(Servo_data[CH_AETR[i]]>>8)&0xFF; //high byte of servo timing(1000-2000us)
uint16_t temp=Servo_data[CH_AETR[i]];
if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR)
temp=servo_mid-temp; //reverse channel
packet[5 + i*2]=temp&0xFF; //low byte of servo timing(1000-2000us)
packet[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us)
}
flysky_apply_extension_flags();
}