mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-13 19:13:14 +00:00
FrSky RX: sub protocol to erase clone IDs
This commit is contained in:
@@ -358,21 +358,35 @@ static void __attribute__((unused)) frsky_rx_data()
|
||||
|
||||
uint16_t initFrSky_Rx()
|
||||
{
|
||||
frsky_rx_chanskip = 1;
|
||||
hopping_frequency_no = 0;
|
||||
rx_data_started = false;
|
||||
frsky_rx_finetune = 0;
|
||||
telemetry_link = 0;
|
||||
packet_count = 0;
|
||||
if (IS_BIND_IN_PROGRESS)
|
||||
if(sub_protocol == FRSKY_ERASE)
|
||||
{
|
||||
frsky_rx_format = FRSKY_RX_D8;
|
||||
frsky_rx_initialise_cc2500();
|
||||
phase = FRSKY_RX_TUNE_START;
|
||||
debugln("FRSKY_RX_TUNE_START");
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{// Clear all cloned addresses
|
||||
uint16_t addr[]={ FRSKYD_CLONE_EEPROM_OFFSET+1, FRSKYX_CLONE_EEPROM_OFFSET+1, FRSKYX2_CLONE_EEPROM_OFFSET+1 };
|
||||
for(uint8_t i=0; i<3;i++)
|
||||
for(uint8_t j=0; j<3;j++)
|
||||
eeprom_write_byte((EE_ADDR)(addr[i]+j), 0xFF);
|
||||
packet_count = 100;
|
||||
}
|
||||
}
|
||||
else
|
||||
frsky_rx_data();
|
||||
{
|
||||
frsky_rx_chanskip = 1;
|
||||
hopping_frequency_no = 0;
|
||||
rx_data_started = false;
|
||||
frsky_rx_finetune = 0;
|
||||
telemetry_link = 0;
|
||||
packet_count = 0;
|
||||
if (IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
frsky_rx_format = FRSKY_RX_D8;
|
||||
frsky_rx_initialise_cc2500();
|
||||
phase = FRSKY_RX_TUNE_START;
|
||||
debugln("FRSKY_RX_TUNE_START");
|
||||
}
|
||||
else
|
||||
frsky_rx_data();
|
||||
}
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@@ -382,6 +396,15 @@ uint16_t FrSky_Rx_callback()
|
||||
static int8_t tune_low, tune_high;
|
||||
uint8_t len, ch;
|
||||
|
||||
if(sub_protocol == FRSKY_ERASE)
|
||||
{
|
||||
if(packet_count)
|
||||
packet_count--;
|
||||
else
|
||||
BIND_DONE;
|
||||
return 10000; // Nothing to do...
|
||||
}
|
||||
|
||||
if(IS_BIND_DONE && phase != FRSKY_RX_DATA) return initFrSky_Rx(); // Abort bind
|
||||
|
||||
if ((prev_option != option) && (phase >= FRSKY_RX_DATA))
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
52,ZSX,280
|
||||
53,Height,5ch,8ch
|
||||
54,Scanner
|
||||
55,Frsky_RX,RX,CloneTX
|
||||
55,Frsky_RX,RX,CloneTX,EraseTX
|
||||
56,AFHDS2A_RX
|
||||
57,HoTT,Sync,No_Sync
|
||||
58,FX816,P38
|
||||
|
||||
@@ -143,7 +143,7 @@ const char STR_SUBTYPE_XK[] = "\x04""X450""X420";
|
||||
const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch""FCC\0 ""--\0 ""FCC 8ch""-- 8ch\0";
|
||||
const char STR_SUBTYPE_ESKY[] = "\x03""Std""ET4";
|
||||
const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z";
|
||||
const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX";
|
||||
const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX""EraseTX";
|
||||
const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch";
|
||||
const char STR_SUBTYPE_WFLY[] = "\x05""WFR0x";
|
||||
const char STR_SUBTYPE_WFLY2[] = "\x05""RF20x";
|
||||
@@ -251,7 +251,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#endif
|
||||
//OpenTX 2.3.x issue: DO NOT CHANGE ORDER below
|
||||
#if defined(FRSKY_RX_CC2500_INO)
|
||||
{PROTO_FRSKY_RX, STR_FRSKY_RX, 2, STR_SUBTYPE_FRSKY_RX, OPTION_RFTUNE },
|
||||
{PROTO_FRSKY_RX, STR_FRSKY_RX, 3, STR_SUBTYPE_FRSKY_RX, OPTION_RFTUNE },
|
||||
#endif
|
||||
#if defined(FRSKYD_CC2500_INO)
|
||||
{PROTO_FRSKYD, STR_FRSKYD, 2, STR_SUBTYPE_FRSKYD, OPTION_RFTUNE },
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 2
|
||||
#define VERSION_PATCH_LEVEL 24
|
||||
#define VERSION_PATCH_LEVEL 25
|
||||
|
||||
//******************
|
||||
// Protocols
|
||||
@@ -373,6 +373,7 @@ enum FRSKY_RX
|
||||
{
|
||||
FRSKY_RX = 0,
|
||||
FRSKY_CLONE = 1,
|
||||
FRSKY_ERASE = 2,
|
||||
};
|
||||
|
||||
enum FRSKYL
|
||||
|
||||
Reference in New Issue
Block a user