Switch all protocols to use a resolution of 2048

- Change how PPM is handled with a resolution of 2048 and scaled to match serial input range. PPM is now fully scaled for all protocols which was not the case before. If you are using PPM, you might have to adjust the end points depending on the protocols.
 - Change all range conversions to use 2048 where possible
 - Updated all protocols with new range functions
 - Protocols which are taking advantage of 2048 are Assan, FrSky V/D/X, DSM, Devo, WK2x01
 - Renamed AUX xto CHx for code readbility
This commit is contained in:
Pascal Langer
2018-01-08 19:37:14 +01:00
parent 11287cb9c0
commit 984aa3f413
39 changed files with 462 additions and 506 deletions

View File

@@ -90,28 +90,28 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
//Flags packet[2]
packet[2] = 0x00;
if(Servo_AUX1)
if(CH5_SW)
packet[2] = BAYANG_FLAG_FLIP;
if(Servo_AUX2)
if(CH6_SW)
packet[2] |= BAYANG_FLAG_RTH;
if(Servo_AUX3)
if(CH7_SW)
packet[2] |= BAYANG_FLAG_PICTURE;
if(Servo_AUX4)
if(CH8_SW)
packet[2] |= BAYANG_FLAG_VIDEO;
if(Servo_AUX5)
if(CH9_SW)
{
packet[2] |= BAYANG_FLAG_HEADLESS;
dyntrim = 0;
}
//Flags packet[3]
packet[3] = 0x00;
if(Servo_AUX6)
if(CH10_SW)
packet[3] = BAYANG_FLAG_INVERTED;
if(Servo_AUX7)
if(CH11_SW)
dyntrim = 0;
if(Servo_AUX8)
if(CH12_SW)
packet[3] |= BAYANG_FLAG_TAKE_OFF;
if(Servo_AUX9)
if(CH13_SW)
packet[3] |= BAYANG_FLAG_EMG_STOP;
//Aileron
val = convert_channel_10b(AILERON);