V761 - Eachine sub protocol

This commit is contained in:
Pascal Langer
2020-06-26 17:54:56 +02:00
parent 8948cb6287
commit ce67a065cd
6 changed files with 62 additions and 13 deletions

View File

@@ -66,23 +66,39 @@ static void __attribute__((unused)) V761_send_packet()
}
else
{
packet[0] = convert_channel_8b(THROTTLE); // throttle
packet[1] = convert_channel_8b(RUDDER)>>1; // rudder
packet[2] = convert_channel_8b(ELEVATOR)>>1; // elevator
packet[3] = convert_channel_8b(AILERON)>>1; // aileron
packet[0] = convert_channel_8b(THROTTLE); // Throttle
packet[2] = convert_channel_8b(ELEVATOR)>>1; // Elevator
if(sub_protocol==V761_STD)
{
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
}
else
{
packet[1] = convert_channel_8b(AILERON)>>1; // Aileron
packet[3] = convert_channel_8b(RUDDER)>>1; // Rudder
}
packet[5] = (packet_count++ / 3)<<6;
packet[4] = (packet[5] == 0x40) ? 0x1a : 0x20;
// Channel 5 - Gyro mode is packet 5
if(CH5_SW) // Mode Expert Gyro off
if(CH5_SW) // Mode Expert Gyro off
flags = 0x0c;
else
if(Channel_data[CH5] < CHANNEL_MIN_COMMAND)
flags = 0x08; // Beginer mode (Gyro on, yaw and pitch rate limited)
flags = 0x08; // Beginer mode (Gyro on, yaw and pitch rate limited)
else
flags = 0x0a; // Mid Mode ( Gyro on no rate limits)
flags = 0x0a; // Mid Mode ( Gyro on no rate limits)
packet[5] |= flags;
packet[6] = 0x80; // unknown
if(sub_protocol==V761_STD)
packet[6] = 0x80; // unknown
else
{
packet[6] = GET_FLAG(CH5_SW, 0x20); // Flip
// RTH???
}
//packet counter
if(packet_count >= 12)