Flysky and Assan output map

This commit is contained in:
Pascal Langer 2017-11-20 19:12:37 +01:00
parent 6cf58c032c
commit b15a5d4a45
2 changed files with 8 additions and 2 deletions

View File

@ -53,7 +53,11 @@ void ASSAN_send_packet()
uint16_t temp;
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+1]=temp;
}

View File

@ -133,7 +133,7 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
{
uint8_t i;
//servodata timing range for flysky.
////-100% =~ 0x03e8//=1000us(min)
//-100% =~ 0x03e8//=1000us(min)
//+100% =~ 0x07ca//=1994us(max)
//Center = 0x5d9//=1497us(center)
//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]];
if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR)
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[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us)
}