FrSky R9: adding CH1-8/CH9-16 and Telem ON/OFF (not that telem is supported yet)

This commit is contained in:
Pascal Langer 2020-07-01 15:39:40 +02:00
parent db4aad04a7
commit 15395de579
4 changed files with 12 additions and 9 deletions

View File

@ -44,11 +44,14 @@ static void __attribute__((unused)) FrSkyR9_build_packet()
//Bind //Bind
if(IS_BIND_IN_PROGRESS) if(IS_BIND_IN_PROGRESS)
{ {// 915 0x01=CH1-8_TELEM_ON 0x41=CH1-8_TELEM_OFF 0xC1=CH9-16_TELEM_OFF 0x81=CH9-16_TELEM_ON
packet[6] = 0x01; // bind indicator
if(sub_protocol & 1) if(sub_protocol & 1)
packet[6] = 0x61; // 868 packet[6] |= 0x20; // 868
else if(binding_idx&0x01)
packet[6] = 0x41; // 915 packet[6] |= 0x40; // telem OFF
if(binding_idx&0x02)
packet[6] |= 0x80; // ch9-16
} }
//SPort //SPort

View File

@ -367,7 +367,6 @@ uint16_t initFrSkyX()
SportHead=SportTail=0; // empty data buffer SportHead=SportTail=0; // empty data buffer
#endif #endif
FrSkyX_RX_Seq = 0 ; // Seq 0 to start with FrSkyX_RX_Seq = 0 ; // Seq 0 to start with
binding_idx=0; // CH1-8 and Telem on
return 10000; return 10000;
} }
#endif #endif

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 1 #define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 25 #define VERSION_PATCH_LEVEL 26
//****************** //******************
// Protocols // Protocols

View File

@ -1063,7 +1063,8 @@ static void protocol_init()
rx_rc_chan[ch] = 1024; rx_rc_chan[ch] = 1024;
#endif #endif
#endif #endif
binding_idx=0;
//Set global ID and rx_tx_addr //Set global ID and rx_tx_addr
MProtocol_id = RX_num + MProtocol_id_master; MProtocol_id = RX_num + MProtocol_id_master;
set_rx_tx_addr(MProtocol_id); set_rx_tx_addr(MProtocol_id);
@ -1878,8 +1879,8 @@ void update_serial_data()
#endif #endif
if(rx_len>27) if(rx_len>27)
{ // Data available for the current protocol { // Data available for the current protocol
#if defined FRSKYX_CC2500_INO #if defined(FRSKYX_CC2500_INO) and defined(FRSKYR9_SX1276_INO)
if((protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2) && rx_len==28) if((protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || protocol==PROTO_FRSKY_R9) && rx_len==28)
{//Protocol waiting for 1 byte during bind {//Protocol waiting for 1 byte during bind
binding_idx=rx_ok_buff[27]; binding_idx=rx_ok_buff[27];
} }