mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-03-26 03:10:00 +00:00
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:
@@ -171,8 +171,9 @@ static void AFHDS2A_build_packet(uint8_t type)
|
||||
packet[0] = 0x58;
|
||||
for(uint8_t ch=0; ch<14; ch++)
|
||||
{
|
||||
packet[9 + ch*2] = Servo_data[CH_AETR[ch]]&0xFF;
|
||||
packet[10 + ch*2] = (Servo_data[CH_AETR[ch]]>>8)&0xFF;
|
||||
uint16_t channelMicros = convert_channel_ppm(CH_AETR[ch]);
|
||||
packet[9 + ch*2] = channelMicros&0xFF;
|
||||
packet[10 + ch*2] = (channelMicros>>8)&0xFF;
|
||||
}
|
||||
break;
|
||||
case AFHDS2A_PACKET_FAILSAFE:
|
||||
@@ -180,7 +181,8 @@ static void AFHDS2A_build_packet(uint8_t type)
|
||||
for(uint8_t ch=0; ch<14; ch++)
|
||||
{
|
||||
#ifdef FAILSAFE_ENABLE
|
||||
uint16_t failsafeMicros = (Failsafe_data[CH_AETR[ch]]*5)/8+860;
|
||||
uint16_t failsafeMicros = Failsafe_data[CH_AETR[ch]];
|
||||
failsafeMicros = (((failsafeMicros<<2)+failsafeMicros)>>3)+860;
|
||||
if( failsafeMicros!=FAILSAFE_CHANNEL_HOLD+860)
|
||||
{ // Failsafe values
|
||||
packet[9 + ch*2] = failsafeMicros & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user