mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-13 19:43:44 +00:00
Flysky and Assan output map
This commit is contained in:
parent
6cf58c032c
commit
b15a5d4a45
@ -53,7 +53,11 @@ void ASSAN_send_packet()
|
|||||||
uint16_t temp;
|
uint16_t temp;
|
||||||
for(uint8_t i=0;i<8;i++)
|
for(uint8_t i=0;i<8;i++)
|
||||||
{
|
{
|
||||||
temp=Servo_data[i]<<3;
|
if(mode_select != MODE_SERIAL) // If in PPM mode extend the output to 1000...2000µs
|
||||||
|
temp=convert_channel_16b_nolim(i,1000,2000);
|
||||||
|
else
|
||||||
|
temp=Servo_data[i];
|
||||||
|
temp<<=3;
|
||||||
packet[2*i]=temp>>8;
|
packet[2*i]=temp>>8;
|
||||||
packet[2*i+1]=temp;
|
packet[2*i+1]=temp;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
|
|||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
//servodata timing range for flysky.
|
//servodata timing range for flysky.
|
||||||
////-100% =~ 0x03e8//=1000us(min)
|
//-100% =~ 0x03e8//=1000us(min)
|
||||||
//+100% =~ 0x07ca//=1994us(max)
|
//+100% =~ 0x07ca//=1994us(max)
|
||||||
//Center = 0x5d9//=1497us(center)
|
//Center = 0x5d9//=1497us(center)
|
||||||
//channel order AIL;ELE;THR;RUD;AUX1;AUX2;AUX3;AUX4
|
//channel order AIL;ELE;THR;RUD;AUX1;AUX2;AUX3;AUX4
|
||||||
@ -147,6 +147,8 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
|
|||||||
uint16_t temp=Servo_data[CH_AETR[i]];
|
uint16_t temp=Servo_data[CH_AETR[i]];
|
||||||
if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR)
|
if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR)
|
||||||
temp=servo_mid-temp; //reverse channel
|
temp=servo_mid-temp; //reverse channel
|
||||||
|
if(mode_select != MODE_SERIAL) //if in PPM mode extend the output to 1000...2000µs
|
||||||
|
temp=map(temp,servo_min_100,servo_max_100,1000,2000);
|
||||||
packet[5 + i*2]=temp&0xFF; //low byte of servo timing(1000-2000us)
|
packet[5 + i*2]=temp&0xFF; //low byte of servo timing(1000-2000us)
|
||||||
packet[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us)
|
packet[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user