FrSkyX add bind options CH1-8/CH9-16 & Telem ON/OFF

This commit is contained in:
pascallanger 2019-12-19 17:26:47 +01:00
parent cace1144db
commit a23d50bf0d
3 changed files with 20 additions and 1 deletions

View File

@ -85,6 +85,11 @@ static void __attribute__((unused)) FrSkyX_build_bind_packet()
// //
uint8_t limit = (sub_protocol & 2 ) ? 31 : 28 ; uint8_t limit = (sub_protocol & 2 ) ? 31 : 28 ;
memset(&packet[13], 0, limit - 13); memset(&packet[13], 0, limit - 13);
if(binding_idx&0x01)
memcpy(&packet[13],(void *)"\x55\xAA\x5A\xA5",4); // Telem off
if(binding_idx&0x02)
memcpy(&packet[17],(void *)"\x55\xAA\x5A\xA5",4); // CH9-16
//
uint16_t lcrc = FrSkyX_crc(&packet[3], limit-3); uint16_t lcrc = FrSkyX_crc(&packet[3], limit-3);
// //
packet[limit++] = lcrc >> 8; packet[limit++] = lcrc >> 8;
@ -431,6 +436,7 @@ 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 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 47 #define VERSION_PATCH_LEVEL 48
//****************** //******************
// Protocols // Protocols
@ -298,6 +298,13 @@ enum ESKY150
ESKY150_4CH = 0, ESKY150_4CH = 0,
ESKY150_7CH = 1, ESKY150_7CH = 1,
}; };
enum XN297DUMP
{
XN297DUMP_250K = 0,
XN297DUMP_1M = 1,
XN297DUMP_2M = 2,
XN297DUMP_AUTO = 3,
};
#define NONE 0 #define NONE 0
#define P_HIGH 1 #define P_HIGH 1

View File

@ -1709,6 +1709,12 @@ 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
#ifdef FRSKYX_CC2500_INO
if(protocol==PROTO_FRSKYX && rx_len==28)
{//Protocol waiting for 1 byte during bind
binding_idx=rx_ok_buff[27];
}
#endif
#ifdef SPORT_SEND #ifdef SPORT_SEND
if(protocol==PROTO_FRSKYX && rx_len==35) if(protocol==PROTO_FRSKYX && rx_len==35)
{//Protocol waiting for 8 bytes {//Protocol waiting for 8 bytes