mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-18 23:03:15 +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:
@@ -245,7 +245,6 @@ static void __attribute__((unused)) DSM_update_channels()
|
||||
|
||||
static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
{
|
||||
uint16_t max = 2047;
|
||||
uint8_t bits = 11;
|
||||
|
||||
if(prev_option!=option)
|
||||
@@ -261,10 +260,7 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
packet[0] = (0xff ^ cyrfmfg_id[2]);
|
||||
packet[1] = (0xff ^ cyrfmfg_id[3]);
|
||||
if(sub_protocol==DSM2_22)
|
||||
{
|
||||
max=1023; // Only DSM_22 is using a resolution of 1024
|
||||
bits=10;
|
||||
}
|
||||
bits=10; // Only DSM_22 is using a resolution of 1024
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < 7; i++)
|
||||
@@ -276,7 +272,8 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
/* Spektrum own remotes transmit normal values during bind and actually
|
||||
* use this (e.g. Nano CP X) to select the transmitter mode (e.g. computer vs
|
||||
* non-computer radio, so always end normal output */
|
||||
value=map(Servo_data[CH_TAER[idx]],servo_min_125,servo_max_125,0,max);
|
||||
value=Channel_data[CH_TAER[idx]];
|
||||
if(bits==10) value>>=1;
|
||||
value |= (upper && i==0 ? 0x8000 : 0) | (idx << bits);
|
||||
}
|
||||
packet[i*2+2] = (value >> 8) & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user