mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-14 03:23:15 +00:00
Merge remote-tracking branch 'refs/remotes/pascallanger/master' into benlye-multi-new
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
18,MJXq,WLH08,X600,X800,H26D,E010,H26WH
|
||||
19,Shenqi
|
||||
20,FY326,FY326,FY319
|
||||
21,SFHSS
|
||||
21,SFHSS,XK,T8J,T10J,TM-FH
|
||||
22,J6PRO
|
||||
23,FQ777
|
||||
24,ASSAN
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 1
|
||||
#define VERSION_REVISION 6
|
||||
#define VERSION_PATCH_LEVEL 23
|
||||
#define VERSION_PATCH_LEVEL 24
|
||||
//******************
|
||||
// Protocols
|
||||
//******************
|
||||
@@ -196,6 +196,13 @@ enum Q303
|
||||
CX10D = 2,
|
||||
CX10WD = 3,
|
||||
};
|
||||
enum SFHSS
|
||||
{
|
||||
XK = 0,
|
||||
T10J = 1,
|
||||
T8J = 2,
|
||||
TM_FH = 3,
|
||||
};
|
||||
|
||||
#define NONE 0
|
||||
#define P_HIGH 1
|
||||
@@ -585,6 +592,11 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
CX35 1
|
||||
CX10D 2
|
||||
CX10WD 3
|
||||
sub_protocol==SFHSS
|
||||
XK 0
|
||||
T10J 1
|
||||
T8J 2
|
||||
TM_FH 3
|
||||
|
||||
Power value => 0x80 0=High/1=Low
|
||||
Stream[3] = option_protocol;
|
||||
|
||||
@@ -155,17 +155,24 @@ static void __attribute__((unused)) SFHSS_build_data_packet()
|
||||
// Values grow down and to the right.
|
||||
static void __attribute__((unused)) SFHSS_build_data_packet()
|
||||
{
|
||||
const uint8_t SFHSS_ident[4][3]={
|
||||
{ 0x81, 0x00, 0x00}, //XK
|
||||
{ 0x81, 0x42, 0x07}, //T8J
|
||||
{ 0x81, 0x0F, 0x09}, //T10J
|
||||
{ 0x82, 0x9A, 0x06} //TM-FH
|
||||
};
|
||||
|
||||
uint8_t ch_offset = phase == SFHSS_DATA1 ? 0 : 4;
|
||||
uint16_t ch1 = convert_channel_16b_nolim(CH_AETR[ch_offset+0],2020,1020);
|
||||
uint16_t ch2 = convert_channel_16b_nolim(CH_AETR[ch_offset+1],2020,1020);
|
||||
uint16_t ch3 = convert_channel_16b_nolim(CH_AETR[ch_offset+2],2020,1020);
|
||||
uint16_t ch4 = convert_channel_16b_nolim(CH_AETR[ch_offset+3],2020,1020);
|
||||
|
||||
packet[0] = 0x81; // can be 80 or 81 for Orange, only 81 for XK
|
||||
packet[0] = SFHSS_ident[sub_protocol][0]; // can be 80 or 81 for Orange
|
||||
packet[1] = rx_tx_addr[0];
|
||||
packet[2] = rx_tx_addr[1];
|
||||
packet[3] = 0x0f; //10J
|
||||
packet[4] = 0x09; //10J
|
||||
packet[3] = SFHSS_ident[sub_protocol][1];
|
||||
packet[4] = SFHSS_ident[sub_protocol][2];
|
||||
packet[5] = (rf_ch_num << 3) | ((ch1 >> 9) & 0x07);
|
||||
packet[6] = (ch1 >> 1);
|
||||
packet[7] = (ch1 << 7) | ((ch2 >> 5) & 0x7F );
|
||||
|
||||
@@ -368,7 +368,10 @@ const PPM_Parameters PPM_prot[15]= {
|
||||
FY326
|
||||
FY319
|
||||
MODE_SFHSS
|
||||
NONE
|
||||
XK
|
||||
T10J
|
||||
T8J
|
||||
TM_FH
|
||||
MODE_J6PRO
|
||||
NONE
|
||||
MODE_FQ777
|
||||
|
||||
Reference in New Issue
Block a user