diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 279688d..8a0a956 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -79,6 +79,7 @@ 65,3,FrSkyR9,R9_968_8CH,0,CH5,CH6,CH7,CH8 55,0,FrSkyRX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 55,1,FrSkyRX,CloneTX,0 +55,2,FrSkyRX,EraseTX,0 58,0,FX816,P38,1 20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib 20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib diff --git a/Multiprotocol/FrSky_Rx_cc2500.ino b/Multiprotocol/FrSky_Rx_cc2500.ino index 0bfa84d..265e224 100644 --- a/Multiprotocol/FrSky_Rx_cc2500.ino +++ b/Multiprotocol/FrSky_Rx_cc2500.ino @@ -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)) diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index b4d2193..a326354 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -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 diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index 8c33e8a..b414109 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -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 }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 2df90bf..ea117ea 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -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 diff --git a/Protocols_Details.md b/Protocols_Details.md index 2c1fd00..54c7fbc 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -560,6 +560,11 @@ Notes: - For FrSkyD, only the RX number used during bind is cloned -> you can't use RX num anymore - For FrSkyX and FrSkyX2, RX number has to be adjusted on each model to match the original TX model +### Sub_protocol EraseTX - *2* +This subprotocol erases ALL the clone IDs which have been recorded. + +To erase ALL the clone information, select the sub_protocol EraseTX and execute a bind. + ## HITEC - *39* Models: OPTIMA, MINIMA and MICRO receivers. @@ -1379,8 +1384,6 @@ A|E|T|R|FLIP||||HEADLESS ### Sub_protocol A180 - *5* Model: XK A180 -**Only 1 ID available** - CH1|CH2|CH3|CH4|CH5 ---|---|---|---|--- A|E|T|R|3D6G