Q222 some channels direction reverse

This commit is contained in:
pascallanger 2016-11-25 11:44:32 +01:00
parent 245d27ea71
commit 1c0ed2a2c1

View File

@ -60,9 +60,6 @@ static void __attribute__((unused)) CX10_Write_Packet(uint8_t bind)
uint16_t aileron=Servo_data[AILERON]; uint16_t aileron=Servo_data[AILERON];
uint16_t elevator=3000-Servo_data[ELEVATOR]; uint16_t elevator=3000-Servo_data[ELEVATOR];
uint16_t rudder=3000-Servo_data[RUDDER]; uint16_t rudder=3000-Servo_data[RUDDER];
packet[9+offset]= lowByte(Servo_data[THROTTLE]);
packet[10+offset]= highByte(Servo_data[THROTTLE]);
// Channel 5 - flip flag // Channel 5 - flip flag
packet[12+offset] = GET_FLAG(Servo_AUX1,CX10_FLAG_FLIP); // flip flag applied on rudder packet[12+offset] = GET_FLAG(Servo_AUX1,CX10_FLAG_FLIP); // flip flag applied on rudder
@ -85,9 +82,9 @@ static void __attribute__((unused)) CX10_Write_Packet(uint8_t bind)
break; break;
case Q282: case Q282:
case Q242: case Q242:
case Q222:
aileron = 3000 - aileron; aileron = 3000 - aileron;
rudder = 3000 - rudder; rudder = 3000 - rudder;
case Q222:
memcpy(&packet[15], "\x10\x10\xaa\xaa\x00\x00", 6); memcpy(&packet[15], "\x10\x10\xaa\xaa\x00\x00", 6);
//FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL //FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
flags2 = GET_FLAG(Servo_AUX1, 0x80) // Channel 5 - FLIP flags2 = GET_FLAG(Servo_AUX1, 0x80) // Channel 5 - FLIP
@ -149,9 +146,11 @@ static void __attribute__((unused)) CX10_Write_Packet(uint8_t bind)
break; break;
} }
packet[5+offset] = lowByte(aileron); packet[5+offset] = lowByte(aileron);
packet[6+offset]= highByte(aileron); packet[6+offset] = highByte(aileron);
packet[7+offset]= lowByte(elevator); packet[7+offset] = lowByte(elevator);
packet[8+offset]= highByte(elevator); packet[8+offset] = highByte(elevator);
packet[9+offset] = lowByte(Servo_data[THROTTLE]);
packet[10+offset]= highByte(Servo_data[THROTTLE]);
packet[11+offset]= lowByte(rudder); packet[11+offset]= lowByte(rudder);
packet[12+offset]|= highByte(rudder); packet[12+offset]|= highByte(rudder);
packet[13+offset]=flags; packet[13+offset]=flags;