From 695264d59a269372c8c1df6f7213ada47f9e1b95 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Tue, 28 Jul 2020 00:55:47 +0200 Subject: [PATCH 01/24] RadioLink: update --- Multiprotocol/FrSkyR9_sx1276.ino | 68 +++++++++++++++++++++++++++++- Multiprotocol/Multi_Names.ino | 8 ++-- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/RadioLink_cc2500.ino | 48 ++++++++++++++++----- 4 files changed, 108 insertions(+), 18 deletions(-) diff --git a/Multiprotocol/FrSkyR9_sx1276.ino b/Multiprotocol/FrSkyR9_sx1276.ino index 1f2f752..057e303 100644 --- a/Multiprotocol/FrSkyR9_sx1276.ino +++ b/Multiprotocol/FrSkyR9_sx1276.ino @@ -102,6 +102,61 @@ static void __attribute__((unused)) FrSkyR9_build_packet() packet[25] = crc >> 8; // high byte } +static uint8_t __attribute__((unused)) FrSkyR9_CRC8(uint8_t *p, uint8_t l) +{ + uint8_t crc = 0xFF; + for (uint8_t i = 0; i < l; i++) + { + crc = crc ^ p[i]; + for ( uint8_t j = 0; j < 8; j++ ) + if ( crc & 0x80 ) + { + crc <<= 1; + crc ^= 0x07; + } + else + crc <<= 1; + } + return crc; +} + +static void __attribute__((unused)) FrSkyR9_build_EU_packet() +{ + //ID + packet[0] = rx_tx_addr[1]; + packet[1] = rx_tx_addr[2]; + packet[2] = rx_tx_addr[3]; + + //Hopping + packet[3] = FrSkyX_chanskip; // step size and last 2 channels start index + + //RX number + packet[4] = RX_num; // receiver number from OpenTX + + //Channels + //TODO FrSkyX_channels(5,4); // Set packet[5]=failsafe and packet[6..11]=4 channels data + + //Bind + if(IS_BIND_IN_PROGRESS) + { + packet[5] = 0x01; // bind indicator + if((sub_protocol & 2) == 0) + packet[5] |= 0x10; // 16CH + // if(sub_protocol & 1) + // packet[5] |= 0x20; // 868 + if(binding_idx&0x01) + packet[5] |= 0x40; // telem OFF + if(binding_idx&0x02) + packet[5] |= 0x80; // ch9-16 + } + + //Sequence and send SPort + packet[12] = (FrSkyX_RX_Seq << 4)|0x08; //TX=8 at startup + + //CRC + packet[13] = FrSkyR9_CRC8(packet, 13); +} + uint16_t initFrSkyR9() { //Check frequencies @@ -127,6 +182,12 @@ uint16_t initFrSkyR9() FrSkyFormat=1; // 8 channels debugln("%dCH", FrSkyFormat&1 ? 8:16); + //EU packet length + if( (sub_protocol & 0xFD) == R9_EU ) + packet_length=14; + else + packet_length=26; + //SX1276 Init SX1276_SetMode(true, false, SX1276_OPMODE_SLEEP); SX1276_SetMode(true, false, SX1276_OPMODE_STDBY); @@ -168,14 +229,17 @@ uint16_t FrSkyR9_callback() // output_power: 2 dBm (17-(15-OutputPower) (if pa_boost_pin == true)) SX1276_SetPaConfig(true, 7, 0); // Lowest power for the T18 //Build packet - FrSkyR9_build_packet(); + if( packet_length == 26 ) + FrSkyR9_build_packet(); + else + FrSkyR9_build_EU_packet(); phase++; return 460; // Frequency settle time case FRSKYR9_DATA: //Set RF switch to TX SX1276_SetTxRxMode(TX_EN); //Send packet - SX1276_WritePayloadToFifo(packet, 26); + SX1276_WritePayloadToFifo(packet, packet_length); SX1276_SetMode(true, false, SX1276_OPMODE_TX); #if not defined TELEMETRY phase=FRSKYR9_FREQ; diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index f549c2f..8bb3847 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -125,7 +125,7 @@ const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2"; const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow"; const char STR_SUBTYPE_POTENSIC[] = "\x03""A20"; const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC"; -const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410"; +const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410""FZ8xx"; const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ""NRF\0 "; const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch"; @@ -141,7 +141,7 @@ const char STR_SUBTYPE_WFLY[] = "\x06""WFR0xS"; const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync"; const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite"; const char STR_SUBTYPE_V761[] = "\x03""3CH""4CH"; -const char STR_SUBTYPE_RLINK[] = "\x07""Surface"; +const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 "; enum { @@ -225,7 +225,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,0, NO_SUBTYPE, OPTION_NONE }, #endif #if defined(FLYZONE_A7105_INO) - {PROTO_FLYZONE, STR_FLYZONE, 1, STR_SUBTYPE_FLYZONE, OPTION_NONE }, + {PROTO_FLYZONE, STR_FLYZONE, 2, STR_SUBTYPE_FLYZONE, OPTION_NONE }, #endif #if defined(FQ777_NRF24L01_INO) {PROTO_FQ777, STR_FQ777, 0, NO_SUBTYPE, OPTION_NONE }, @@ -327,7 +327,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_REDPINE, STR_REDPINE, 2, STR_SUBTYPE_REDPINE, OPTION_RFTUNE }, #endif #if defined(RLINK_CC2500_INO) - {PROTO_RLINK, STR_RLINK, 1, STR_SUBTYPE_RLINK, OPTION_RFTUNE }, + {PROTO_RLINK, STR_RLINK, 2, STR_SUBTYPE_RLINK, OPTION_RFTUNE }, #endif #if defined(SCANNER_CC2500_INO) // {PROTO_SCANNER, STR_SCANNER, 0, NO_SUBTYPE, OPTION_NONE }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index f6040ce..a95f791 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 45 +#define VERSION_PATCH_LEVEL 46 //****************** // Protocols diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index 6f3ad5e..45ca8a6 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -23,6 +23,7 @@ #define RLINK_TX_PACKET_LEN 33 #define RLINK_RX_PACKET_LEN 15 #define RLINK_TX_ID_LEN 4 +#define RLINK_HOP 16 enum { RLINK_DATA = 0x00, @@ -40,15 +41,32 @@ const PROGMEM uint8_t RLINK_init_values[] = { static void __attribute__((unused)) RLINK_init() { + hopping_frequency[RLINK_HOP]=16; + // channels order depend on ID and currently unknown... #ifdef RLINK_FORCE_ID + //surface memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN); + memcpy(hopping_frequency,"\x1\xF\x8\x9\x2\x5\x0\x6\x4\xE\xB\xD\x3\xA\xC\x7",RLINK_HOP); //end value is value*12+6 + //air + memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN); + memcpy(hopping_frequency,"\xB\xC\xF\xE\x5\x9\x8\x4\x3\x7\xA\x1\xD\x0\x6\x2",RLINK_HOP); //end value is value*12 #endif - // channels order depend on ID and currently unknown... - memcpy(hopping_frequency,"\x12\xBA\x66\x72\x1E\x42\x06\x4E\x36\xAE\x8A\xA2\x2A\x7E\x96\x5A",16); // 1,15,8,9,2,5,0,6,4,14,11,13,3,10,12,7 : end value is value*12+6 + // set channels value based on ID + for(uint8_t i=0;i<=RLINK_HOP;i++) + hopping_frequency[i]=3*(4*hopping_frequency[i]+(rx_tx_addr[0]&3)); - rf_ch_num=(random(0xfefefefe)&0x0F)+1; // 0x01..0x10 - hopping_frequency[rf_ch_num]=0xC6; + // replace one of the channel randomely + rf_ch_num=random(0xfefefefe)&0x0F; // 0x00..0x0F + if(hopping_frequency[RLINK_HOP]==0xC9) + hopping_frequency[rf_ch_num]=0xC6; + else + hopping_frequency[rf_ch_num]=hopping_frequency[RLINK_HOP]; + + debug("Hop(%d):", rf_ch_num); + for(uint8_t i=0;i3?0x03:0x01; // packet type: 0x01 normal, 0x03 request telemetry - //if(RX_num) packet[1] |= ((RX_num+2)<<4)+4; // RX number limited to 10 values, 0 is a wildcard + if(sub_protocol) + packet[1] = 0x21; //air 0x21 on dump but it looks to support telemetry + else + {//surface + packet[1] = 0x00; + //radiolink additionnal ID which is working only on a small set of RXs + //if(RX_num) packet[1] |= ((RX_num+2)<<4)+4; // RX number limited to 10 values, 0 is a wildcard + } + packet[1] |= packet_count>3?0x03:0x01; // packet type: 0x01 normal, 0x03 request telemetry // ID memcpy(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN); @@ -132,7 +157,7 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet() packet_count++; if(packet_count>5) packet_count=0; - //debug("P:"); + //debug("P(%02X):",hopping_frequency[pseudo & 0x0F]); //for(uint8_t i=0;i= 2000) - {//1 packet every 20ms + {//1 telemetry packet every 100ms pps_timer = millis(); + pps_counter*=5; debugln("%d pps", pps_counter); TX_LQI = pps_counter; //Max=100% pps_counter = 0; From 354878d542fa7c1fc4f5fd2dbe882e3f0e349298 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Tue, 28 Jul 2020 15:53:58 +0200 Subject: [PATCH 02/24] RadioLink: preparation for final --- Multiprotocol/Multi_Names.ino | 4 +- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/RadioLink_cc2500.ino | 102 +++++++++++++++++------------ Protocols_Details.md | 11 +++- 4 files changed, 73 insertions(+), 46 deletions(-) diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index 8bb3847..b5905fe 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -125,7 +125,7 @@ const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2"; const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow"; const char STR_SUBTYPE_POTENSIC[] = "\x03""A20"; const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC"; -const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410""FZ8xx"; +const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410"; const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ""NRF\0 "; const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch"; @@ -225,7 +225,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,0, NO_SUBTYPE, OPTION_NONE }, #endif #if defined(FLYZONE_A7105_INO) - {PROTO_FLYZONE, STR_FLYZONE, 2, STR_SUBTYPE_FLYZONE, OPTION_NONE }, + {PROTO_FLYZONE, STR_FLYZONE, 1, STR_SUBTYPE_FLYZONE, OPTION_NONE }, #endif #if defined(FQ777_NRF24L01_INO) {PROTO_FQ777, STR_FQ777, 0, NO_SUBTYPE, OPTION_NONE }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index a95f791..255a0b2 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 46 +#define VERSION_PATCH_LEVEL 47 //****************** // Protocols diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index 45ca8a6..d5275cd 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -31,6 +31,50 @@ enum { RLINK_RX2 = 0x02, }; +const PROGMEM uint8_t RLINK_hopping[][8] = { + /* 00 */ { 0x1F, 0x89, 0x25, 0x06, 0x4E, 0xBD, 0x3A, 0xC7 }, + /* 01 */ { 0xBC, 0xFE, 0x59, 0x84, 0x37, 0xA1, 0xD0, 0x62 } +}; + +static void __attribute__((unused)) RLINK_load_hopp(uint8_t num) +{ + uint8_t inc=3*(rx_tx_addr[0]&3); + + for (uint8_t i = 0; i < RLINK_HOP>>1; i++) + { + uint8_t val=pgm_read_byte_near(&RLINK_hopping[num][i]); + hopping_frequency[ i<<1 ]=12*(val>>4 )+inc; + hopping_frequency[(i<<1)+1]=12*(val&0x0F)+inc; + } + + // replace one of the channel randomely + rf_ch_num=random(0xfefefefe)%0x11; // 0x00..0x10 + if(inc==9) inc=6; // frequency exception + hopping_frequency[rf_ch_num]=12*16+inc; +} + +static void __attribute__((unused)) RLINK_init() +{ + // channels order depend on ID and currently unknown... + #ifdef RLINK_FORCE_ID + //surface RC6GS + memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN); + RLINK_load_hopp(0); + //air T8FB + //memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN); + //RLINK_load_hopp(1); + #endif + + debug("ID:"); + for(uint8_t i=0;i3?0x03:0x01; // packet type: 0x01 normal, 0x03 request telemetry + if(packet_count>3) + packet[1] |= 0x02; // 0x02 telemetry request flag // ID memcpy(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN); @@ -142,7 +157,7 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet() packet[29]= pseudo >> 8; packet[30]= 0x00; // unknown packet[31]= 0x00; // unknown - packet[32]= rf_ch_num; // value equal to 0xC6 in the RF table + packet[32]= rf_ch_num; // index of value changed in the RF table // check uint8_t sum=0; @@ -157,13 +172,14 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet() packet_count++; if(packet_count>5) packet_count=0; - //debug("P(%02X):",hopping_frequency[pseudo & 0x0F]); - //for(uint8_t i=0;i= 2000) {//1 telemetry packet every 100ms pps_timer = millis(); - pps_counter*=5; + if(pps_counter<20) + pps_counter*=5; + else + pps_counter=100; debugln("%d pps", pps_counter); - TX_LQI = pps_counter; //Max=100% + TX_LQI = pps_counter; //0..100% pps_counter = 0; } CC2500_SetTxRxMode(TX_EN); diff --git a/Protocols_Details.md b/Protocols_Details.md index 830473c..a3fbce0 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -117,7 +117,7 @@ CFlie|38|CFlie||||||||NRF24L01| [Q2X2](Protocols_Details.md#Q2X2---29)|29|Q222|Q242|Q282||||||NRF24L01| [Q303](Protocols_Details.md#Q303---31)|31|Q303|CX35|CX10D|CX10WD|||||NRF24L01|XN297 [Q90C](Protocols_Details.md#Q90C---72)|72|Q90C*||||||||NRF24L01|XN297 -[RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface||||||||CC2500| +[RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface|Air|||||||CC2500| [Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01| [Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500| [SFHSS](Protocols_Details.md#SFHSS---21)|21|SFHSS||||||||CC2500| @@ -558,7 +558,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|FS_CH1|FS_CH2|FS_CH3|FS_CH4|FS_CH5|FS_CH6|FS_CH7 FS=FailSafe ### Sub_protocol Surface - *0* -Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM +Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM and more **Only 1 ID for now** @@ -566,6 +566,13 @@ CH1=Steering, CH2=Throttle, CH8=Gyro gain Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt +### Sub_protocol Air - *1* +Surface protocol. TXs: T8FB,. Compatible RXs:R8EF,R8FM,R4FG,R4F and more + +**Only 1 ID for now** + +Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%) + ## SFHSS - *21* Models: Futaba RXs and XK models. From df28cfe3ccceb24232ecedf70563405f6e5699b4 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 31 Jul 2020 10:41:07 +0200 Subject: [PATCH 03/24] Radiolink: final version with 64 IDs --- Lua_scripts/MultiChan.txt | 4 +- Multiprotocol/Multiprotocol.ino | 10 ++++ Multiprotocol/RadioLink_cc2500.ino | 88 +++++++++++++++++++++++++++--- Multiprotocol/Validate.h | 5 ++ Multiprotocol/_Config.h | 8 ++- Protocols_Details.md | 21 ++++--- 6 files changed, 117 insertions(+), 19 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 6fa989d..5aeccab 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -54,7 +54,8 @@ 28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -53,0,Flyzone,FZ-410,0 +53,0,Flyzone,5ch,0,Gear +53,1,Flyzone,8ch,0,Gear,Gyro,Flap,Light 25,0,FrSkyV,V8,0,CH5,CH6,CH7,CH8 3,0,FrSkyD,D8,0,CH5,CH6,CH7,CH8 3,0,FrSkyD,D8Cloned,0,CH5,CH6,CH7,CH8 @@ -137,6 +138,7 @@ 50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 +74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 21,0,SFHSS,Std,0,CH5,CH6,CH7,CH8 19,0,Shenqi,Cycle,1 68,0,Skyartec,Std,0,CH5,CH6,CH7 diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 9fdc022..0b1e6dd 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -560,6 +560,11 @@ void setup() option = FORCE_REDPINE_TUNING; // Use config-defined tuning value for REDPINE else #endif + #if defined(FORCE_RADIOLINK_TUNING) && defined(RADIOLINK_CC2500_INO) + if (protocol==PROTO_RADIOLINK) + option = FORCE_RADIOLINK_TUNING; // Use config-defined tuning value for RADIOLINK + else + #endif #if defined(FORCE_HITEC_TUNING) && defined(HITEC_CC2500_INO) if (protocol==PROTO_HITEC) option = FORCE_HITEC_TUNING; // Use config-defined tuning value for HITEC @@ -1751,6 +1756,11 @@ void update_serial_data() option=FORCE_REDPINE_TUNING; // Use config-defined tuning value for REDPINE else #endif + #if defined(FORCE_RADIOLINK_TUNING) && defined(RADIOLINK_CC2500_INO) + if (protocol==PROTO_RADIOLINK) + option = FORCE_RADIOLINK_TUNING; // Use config-defined tuning value for RADIOLINK + else + #endif #if defined(FORCE_HITEC_TUNING) && defined(HITEC_CC2500_INO) if (protocol==PROTO_HITEC) option=FORCE_HITEC_TUNING; // Use config-defined tuning value for HITEC diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index d5275cd..93c0ed9 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -18,7 +18,7 @@ #include "iface_cc2500.h" -#define RLINK_FORCE_ID +//#define RLINK_FORCE_ID #define RLINK_TX_PACKET_LEN 33 #define RLINK_RX_PACKET_LEN 15 @@ -32,8 +32,74 @@ enum { }; const PROGMEM uint8_t RLINK_hopping[][8] = { - /* 00 */ { 0x1F, 0x89, 0x25, 0x06, 0x4E, 0xBD, 0x3A, 0xC7 }, - /* 01 */ { 0xBC, 0xFE, 0x59, 0x84, 0x37, 0xA1, 0xD0, 0x62 } + /* 4C494E4B */ { 0xBC, 0x5A, 0x70, 0x4E, 0xDF, 0x32, 0x16, 0x89 }, + /* 4D494E4B */ { 0x4C, 0xF3, 0xEA, 0x5B, 0x62, 0x9D, 0x01, 0x87 }, + /* 4E494E4B */ { 0x86, 0xEA, 0xD0, 0xC9, 0x2B, 0x53, 0x7F, 0x41 }, + /* 4F494E4B */ { 0xAC, 0x91, 0x7D, 0x48, 0xE0, 0xB5, 0x32, 0xF6 }, + /* 50494E4B */ { 0xD6, 0x7C, 0xA4, 0x93, 0x5F, 0xE1, 0x02, 0xB8 }, + /* 51494E4B */ { 0xED, 0x04, 0x73, 0xC8, 0x56, 0xB9, 0x1F, 0xA2 }, + /* 52494E4B */ { 0xA7, 0xF0, 0x36, 0xB2, 0x95, 0x4E, 0x1C, 0xD8 }, + /* 53494E4B */ { 0x76, 0x8B, 0xA0, 0x3E, 0x51, 0x4C, 0x9D, 0x2F }, + /* 54494E4B */ { 0x07, 0x23, 0x16, 0xFD, 0xC9, 0x5B, 0x84, 0xAE }, + /* 55494E4B */ { 0xD3, 0xA0, 0x69, 0xBF, 0x12, 0x8C, 0x4E, 0x57 }, + /* 56494E4B */ { 0xA6, 0xBE, 0x91, 0xD3, 0x7C, 0x4F, 0x82, 0x50 }, + /* 57494E4B */ { 0x91, 0xDA, 0xBC, 0x75, 0x82, 0x36, 0x4E, 0xF0 }, + /* 58494E4B */ { 0x9A, 0x27, 0x5C, 0xF4, 0xD8, 0xB0, 0x36, 0xE1 }, + /* 59494E4B */ { 0x92, 0xF1, 0x34, 0xA7, 0x5B, 0x0C, 0xED, 0x86 }, + /* 5A494E4B */ { 0x8C, 0x2B, 0x51, 0xF9, 0x3E, 0x4A, 0x67, 0xD0 }, + /* 5B494E4B */ { 0x5E, 0x3D, 0x67, 0x9B, 0xA2, 0x84, 0xFC, 0x01 }, + /* 5C494E4B */ { 0xF9, 0x35, 0xBD, 0x78, 0x26, 0x1C, 0x0E, 0xA4 }, + /* 5D494E4B */ { 0xD9, 0x7B, 0x48, 0x0E, 0x2A, 0xCF, 0x13, 0x65 }, + /* 5E494E4B */ { 0x07, 0xE4, 0xF9, 0x8A, 0x3C, 0x21, 0xB5, 0xD6 }, + /* 5F494E4B */ { 0xEB, 0xFA, 0x29, 0xD1, 0x54, 0x3C, 0x07, 0x86 }, + /* 60494E4B */ { 0xDF, 0xCE, 0x0A, 0x32, 0x71, 0x5B, 0x96, 0x48 }, + /* 61494E4B */ { 0x19, 0x86, 0xF5, 0x3A, 0x27, 0xDC, 0x0E, 0xB4 }, + /* 62494E4B */ { 0xF8, 0x47, 0x9C, 0xE0, 0x2D, 0xBA, 0x15, 0x36 }, + /* 63494E4B */ { 0xED, 0x78, 0x01, 0xA3, 0x2B, 0x6C, 0x45, 0xF9 }, + /* 64494E4B */ { 0xE0, 0xA2, 0xD4, 0x6B, 0xF5, 0x18, 0x3C, 0x79 }, + /* 65494E4B */ { 0x26, 0x90, 0x8B, 0x5D, 0x31, 0xCF, 0xE7, 0x4A }, + /* 66494E4B */ { 0x7B, 0x12, 0xA8, 0x4F, 0xC0, 0x65, 0xD9, 0x3E }, + /* 67494E4B */ { 0x35, 0xA2, 0x14, 0xBE, 0x06, 0x7D, 0x98, 0xFC }, + /* 68494E4B */ { 0xD2, 0xA9, 0x7E, 0x40, 0x6F, 0x83, 0x5C, 0xB1 }, + /* 69494E4B */ { 0xE5, 0xB9, 0xC1, 0x04, 0x83, 0x27, 0xA6, 0xFD }, + /* 6A494E4B */ { 0x8E, 0x0C, 0x4A, 0x51, 0xFB, 0x63, 0x92, 0x7D }, + /* 6B494E4B */ { 0xC7, 0x1D, 0x02, 0x93, 0x45, 0xF8, 0xA6, 0xBE }, + /* 6C494E4B */ { 0xC1, 0x64, 0x59, 0x0A, 0x7D, 0x3F, 0x28, 0xEB }, + /* 6D494E4B */ { 0xEF, 0x75, 0xAB, 0x94, 0xD2, 0x83, 0x1C, 0x60 }, + /* 6E494E4B */ { 0xA1, 0x20, 0x54, 0x68, 0x9E, 0x7B, 0x3D, 0xFC }, + /* 6F494E4B */ { 0x3E, 0x60, 0x28, 0xFC, 0xDA, 0x45, 0x9B, 0x71 }, + /* 70494E4B */ { 0xB7, 0x0E, 0xA8, 0x23, 0xFC, 0x65, 0x4D, 0x91 }, + /* 71494E4B */ { 0x29, 0x34, 0x51, 0x7C, 0xB8, 0xFD, 0x0E, 0x6A }, + /* 72494E4B */ { 0x1B, 0x06, 0x3C, 0x89, 0xF5, 0x2A, 0x7E, 0xD4 }, + /* 73494E4B */ { 0xF2, 0xC9, 0x63, 0x57, 0x0A, 0xB1, 0x48, 0xDE }, + /* 74494E4B */ { 0x24, 0xAE, 0x0C, 0x19, 0x53, 0x7B, 0xF6, 0x8D }, + /* 75494E4B */ { 0xEC, 0xD8, 0xF2, 0x4B, 0xA3, 0x51, 0x09, 0x76 }, + /* 76494E4B */ { 0x98, 0x71, 0x5E, 0xAD, 0xFC, 0x04, 0x3B, 0x62 }, + /* 77494E4B */ { 0xAE, 0xF6, 0xB7, 0x01, 0x52, 0x34, 0x9D, 0x8C }, + /* 78494E4B */ { 0x69, 0x48, 0xF1, 0x3C, 0xDB, 0x0E, 0x25, 0xA7 }, + /* 79494E4B */ { 0xCF, 0x60, 0x94, 0xAD, 0xB1, 0x82, 0x73, 0xE5 }, + /* 7A494E4B */ { 0xFA, 0xC1, 0xD7, 0xB0, 0x53, 0x92, 0x6E, 0x48 }, + /* 7B494E4B */ { 0xAC, 0x7D, 0xE5, 0x8B, 0x41, 0x96, 0x2F, 0x30 }, + /* 7C494E4B */ { 0xFD, 0xC1, 0xB9, 0x02, 0xE4, 0x87, 0x56, 0x3A }, + /* 7D494E4B */ { 0x30, 0xDA, 0x4F, 0x8E, 0x5C, 0xB9, 0x26, 0x71 }, + /* 7E494E4B */ { 0xDC, 0xF9, 0x57, 0x30, 0x82, 0x1E, 0x6A, 0x4B }, + /* 7F494E4B */ { 0x84, 0x1D, 0x7E, 0x29, 0x3C, 0x65, 0xA0, 0xBF }, + /* 80494E4B */ { 0x01, 0xA3, 0xF6, 0xE2, 0x4C, 0x8B, 0x5D, 0x79 }, + /* 81494E4B */ { 0xA1, 0x32, 0xE7, 0x08, 0x4D, 0x5B, 0x9F, 0x6C }, + /* 82494E4B */ { 0x31, 0x40, 0x67, 0x8F, 0xBA, 0x95, 0x2C, 0xED }, + /* 83494E4B */ { 0x91, 0x76, 0xFA, 0x83, 0x20, 0x4B, 0xEC, 0x5D }, + /* 84494E4B */ { 0xDB, 0x54, 0xC2, 0x61, 0xF0, 0xA9, 0x87, 0x3E }, + /* 85494E4B */ { 0xC0, 0xB4, 0x61, 0xD3, 0x7A, 0x5F, 0x82, 0x9E }, + /* 86494E4B */ { 0xD6, 0xCF, 0x9B, 0x75, 0xE1, 0x42, 0x3A, 0x80 }, + /* 87494E4B */ { 0xFE, 0xA2, 0xB4, 0x9C, 0x10, 0x7D, 0x56, 0x83 }, + /* 88494E4B */ { 0xD2, 0x79, 0x54, 0xEF, 0xC8, 0x0B, 0x36, 0xA1 }, + /* 89494E4B */ { 0x8D, 0xCF, 0x23, 0x64, 0xE5, 0x0B, 0x1A, 0x97 }, + /* 8A494E4B */ { 0x07, 0xC4, 0xEF, 0x9A, 0x61, 0xD8, 0xB3, 0x52 }, + /* 8B494E4B */ { 0x45, 0x6E, 0xBF, 0x8C, 0x9A, 0x2D, 0x31, 0x70 }, +#ifdef RLINK_FORCE_ID + /* 3A99223A */ { 0x1F, 0x89, 0x25, 0x06, 0x4E, 0xBD, 0x3A, 0xC7 }, + /* FC110D20 */ { 0xBC, 0xFE, 0x59, 0x84, 0x37, 0xA1, 0xD0, 0x62 } + #endif }; static void __attribute__((unused)) RLINK_load_hopp(uint8_t num) @@ -55,17 +121,22 @@ static void __attribute__((unused)) RLINK_load_hopp(uint8_t num) static void __attribute__((unused)) RLINK_init() { - // channels order depend on ID and currently unknown... + // channels order depend on ID and currently unknown so using a table of 64 entries... + uint8_t id=rx_tx_addr[3]&0x3F; + RLINK_load_hopp(id); + memcpy(rx_tx_addr,"\x4C\x49\x4E\x4B",RLINK_TX_ID_LEN); + rx_tx_addr[0] += id; + #ifdef RLINK_FORCE_ID //surface RC6GS memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN); - RLINK_load_hopp(0); + RLINK_load_hopp(64); //air T8FB //memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN); - //RLINK_load_hopp(1); + //RLINK_load_hopp(65); #endif - debug("ID:"); +/* debug("ID:"); for(uint8_t i=0;i 127 ) + #error "The RADIOLINK forced frequency tuning value is outside of the range -127..127." + #endif +#endif #ifdef FORCE_SFHSS_TUNING #if ( FORCE_SFHSS_TUNING < -127 ) || ( FORCE_SFHSS_TUNING > 127 ) #error "The SFHSS forced frequency tuning value is outside of the range -127..127." diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index a118190..713c4f2 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -100,11 +100,12 @@ //#define FORCE_FRSKYL_TUNING 0 //#define FORCE_FRSKYV_TUNING 0 //#define FORCE_FRSKYX_TUNING 0 -//#define FORCE_SFHSS_TUNING 0 -//#define FORCE_SKYARTEC_TUNING 0 //#define FORCE_HITEC_TUNING 0 //#define FORCE_HOTT_TUNING 0 +//#define FORCE_RADIOLINK_TUNING 0 //#define FORCE_REDPINE_TUNING 0 +//#define FORCE_SFHSS_TUNING 0 +//#define FORCE_SKYARTEC_TUNING 0 /** A7105 Fine Frequency Tuning **/ //This is required in rare cases where some A7105 modules and/or RXs have an inaccurate crystal oscillator. @@ -580,7 +581,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { V912 CX20 PROTO_FLYZONE - FZ410 + FLYZONE_5CH + FLYZONE_8CH PROTO_FQ777 NONE PROTO_FRSKY_RX diff --git a/Protocols_Details.md b/Protocols_Details.md index a3fbce0..ca4e301 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -240,11 +240,20 @@ Extended limits supported Low power: enable/disable the LNA stage on the RF component to use depending on the distance with the TX. ## FLYZONE - *53* + +### Sub_protocol 5CH - *0* Models using the Flyzone FZ-410 TX: Fokker D.VII Micro EP RTF. Models using the old ARES TX (prior to Hitec RED) Tiger Moth, eRC Micro Stick and Rage R/C. -CH1|CH2|CH3|CH4 ----|---|---|--- -A|E|T|R +CH1|CH2|CH3|CH4|CH5 +---|---|---|---|--- +A|E|T|R|Gear + +### Sub_protocol 8CH - *1* +Models using the new 8 channels radio Flyzone, eRC and Rage R/C. + +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8 +---|---|---|---|---|---|---|--- +A|E|T|R|Gear|Gyro|Flap|Light ## HUBSAN - *2* @@ -548,6 +557,8 @@ You should definitively upgrade your receivers/sensors to the latest firmware ve Extended limits +**64 IDs available, use RX num to scroll through them** + Option for this protocol corresponds to fine frequency tuning. This value is different for each Module and **must** be accurate otherwise the link will not be stable. Check the [Frequency Tuning page](/docs/Frequency_Tuning.md) to determine it. @@ -560,8 +571,6 @@ FS=FailSafe ### Sub_protocol Surface - *0* Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM and more -**Only 1 ID for now** - CH1=Steering, CH2=Throttle, CH8=Gyro gain Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt @@ -569,8 +578,6 @@ Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), ### Sub_protocol Air - *1* Surface protocol. TXs: T8FB,. Compatible RXs:R8EF,R8FM,R4FG,R4F and more -**Only 1 ID for now** - Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%) ## SFHSS - *21* From 19164521e47a1448063fe680516d885f2001c479 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 31 Jul 2020 10:42:10 +0200 Subject: [PATCH 04/24] Flyzone protocol: 8 channels support --- Multiprotocol/A7105_SPI.ino | 4 ++++ Multiprotocol/Flyzone_a7105.ino | 8 +++++++- Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Names.ino | 6 +++--- Multiprotocol/Multiprotocol.h | 11 ++++++++++- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Multiprotocol/A7105_SPI.ino b/Multiprotocol/A7105_SPI.ino index fe76637..3399513 100644 --- a/Multiprotocol/A7105_SPI.ino +++ b/Multiprotocol/A7105_SPI.ino @@ -383,6 +383,10 @@ void A7105_Init(void) if(i==0x20) val=0x1E; } #endif + #ifdef FLYZONE_A7105_INO + if(protocol==PROTO_FLYZONE && sub_protocol==FLYZONE_8CH) + if(i==0x03) val=0x0A; + #endif if( val != 0xFF) A7105_WriteReg(i, val); } diff --git a/Multiprotocol/Flyzone_a7105.ino b/Multiprotocol/Flyzone_a7105.ino index 6accb00..4a9714e 100644 --- a/Multiprotocol/Flyzone_a7105.ino +++ b/Multiprotocol/Flyzone_a7105.ino @@ -33,6 +33,12 @@ static void __attribute__((unused)) flyzone_build_packet() packet[5] = convert_channel_8b(THROTTLE); //00..FF packet[6] = convert_channel_8b(RUDDER); //00..80..FF packet[7] = convert_channel_8b(CH5); //00..80..FF + if(sub_protocol == FLYZONE_8CH) + { + packet[8] = convert_channel_8b(CH6); //00..80..FF + packet[9] = convert_channel_8b(CH7); //00..80..FF + packet[10] = convert_channel_8b(CH8); //00..80..FF + } } uint16_t ReadFlyzone() @@ -59,7 +65,7 @@ uint16_t ReadFlyzone() telemetry_set_input_sync(20*1500); #endif flyzone_build_packet(); - A7105_WriteData(8, hopping_frequency[0]); + A7105_WriteData(sub_protocol?11:8, hopping_frequency[0]); A7105_SetPower(); } else diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index 803e6e9..ab5ffb9 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -50,7 +50,7 @@ 50,Redpine,Fast,Slow 51,Potensic,A20 52,ZSX,280 -53,Flyzone,FZ-410 +53,Flyzone,5ch,8ch 54,Scanner 55,Frsky_RX,RX,CloneTX 56,AFHDS2A_RX diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index b5905fe..9cce375 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -125,7 +125,7 @@ const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2"; const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow"; const char STR_SUBTYPE_POTENSIC[] = "\x03""A20"; const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC"; -const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410"; +const char STR_SUBTYPE_FLYZONE[] = "\x03""5ch""8ch"; const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ""NRF\0 "; const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch"; @@ -140,7 +140,7 @@ const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch"; const char STR_SUBTYPE_WFLY[] = "\x06""WFR0xS"; const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync"; const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite"; -const char STR_SUBTYPE_V761[] = "\x03""3CH""4CH"; +const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch"; const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 "; enum @@ -225,7 +225,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,0, NO_SUBTYPE, OPTION_NONE }, #endif #if defined(FLYZONE_A7105_INO) - {PROTO_FLYZONE, STR_FLYZONE, 1, STR_SUBTYPE_FLYZONE, OPTION_NONE }, + {PROTO_FLYZONE, STR_FLYZONE, 2, STR_SUBTYPE_FLYZONE, OPTION_NONE }, #endif #if defined(FQ777_NRF24L01_INO) {PROTO_FQ777, STR_FQ777, 0, NO_SUBTYPE, OPTION_NONE }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 255a0b2..381e501 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 47 +#define VERSION_PATCH_LEVEL 48 //****************** // Protocols @@ -390,6 +390,12 @@ enum V761 V761_4CH = 1, }; +enum FLYZONE +{ + FLYZONE_5CH = 0, + FLYZONE_8CH = 1, +}; + #define NONE 0 #define P_HIGH 1 #define P_LOW 0 @@ -993,6 +999,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- sub_protocol==V761 V761_3CH 0 V761_4CH 1 + sub_protocol==FLYZONE + FLYZONE_5CH 0 + FLYZONE_8CH 1 Power value => 0x80 0=High/1=Low Stream[3] = option_protocol; From 0932a1c93f89be151c5862b8b1704a4d17d64dc8 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 31 Jul 2020 10:52:37 +0200 Subject: [PATCH 05/24] Update Protocols_Details.md --- Protocols_Details.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index ca4e301..7d02e47 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -576,7 +576,7 @@ CH1=Steering, CH2=Throttle, CH8=Gyro gain Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt ### Sub_protocol Air - *1* -Surface protocol. TXs: T8FB,. Compatible RXs:R8EF,R8FM,R4FG,R4F and more +Air protocol. TXs: T8FB,T8S. Compatible RXs:R8EF,R8FM,R4FG,R4F and more Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%) From 51d39bbd8c6b83ebb5c8221eca5ea6452bacb14c Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 31 Jul 2020 10:56:34 +0200 Subject: [PATCH 06/24] RadioLink: add RXs to the supported list --- Protocols_Details.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index 7d02e47..7281342 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -569,14 +569,14 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|FS_CH1|FS_CH2|FS_CH3|FS_CH4|FS_CH5|FS_CH6|FS_CH7 FS=FailSafe ### Sub_protocol Surface - *0* -Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM and more +Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM,R4F and more CH1=Steering, CH2=Throttle, CH8=Gyro gain Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt ### Sub_protocol Air - *1* -Air protocol. TXs: T8FB,T8S. Compatible RXs:R8EF,R8FM,R4FG,R4F and more +Air protocol. TXs: T8FB,T8S. Compatible RXs:R8EF,R8FM,R8SM,R4FG,R4F and more Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%) From 37138f03ae70d61499f55d934d4271996555fdf1 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 31 Jul 2020 15:58:07 +0200 Subject: [PATCH 07/24] Few fixes --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/Multiprotocol.ino | 2 +- Multiprotocol/Pelikan_a7105.ino | 5 +++-- Multiprotocol/Validate.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 381e501..24d17d5 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 48 +#define VERSION_PATCH_LEVEL 49 //****************** // Protocols diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 0b1e6dd..254ef67 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1915,7 +1915,7 @@ void update_serial_data() } #endif #ifdef SPORT_SEND - if((protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || PROTO_FRSKY_R9) && rx_len==35) + if((protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || protocol==PROTO_FRSKY_R9) && rx_len==35) {//Protocol waiting for 8 bytes #define BYTE_STUFF 0x7D #define STUFF_MASK 0x20 diff --git a/Multiprotocol/Pelikan_a7105.ino b/Multiprotocol/Pelikan_a7105.ino index 708e0b8..59558dc 100644 --- a/Multiprotocol/Pelikan_a7105.ino +++ b/Multiprotocol/Pelikan_a7105.ino @@ -127,7 +127,7 @@ uint16_t ReadPelikan() if(sub_protocol==PELIKAN_PRO) A7105_WriteReg(A7105_03_FIFOI,0x28); else//PELIKAN_LITE - A7105_WriteID((rx_tx_addr[0]<<24)|(rx_tx_addr[1]<<16)|(rx_tx_addr[2]<<8)|(rx_tx_addr[3])); + A7105_WriteID(MProtocol_id); } } #ifdef MULTI_SYNC @@ -281,8 +281,9 @@ uint16_t initPelikan() } #endif + MProtocol_id=((uint32_t)rx_tx_addr[0]<<24)|((uint32_t)rx_tx_addr[1]<<16)|((uint32_t)rx_tx_addr[2]<<8)|(rx_tx_addr[3]); if(sub_protocol==PELIKAN_LITE && IS_BIND_DONE) - A7105_WriteID((rx_tx_addr[0]<<24)|(rx_tx_addr[1]<<16)|(rx_tx_addr[2]<<8)|(rx_tx_addr[3])); + A7105_WriteID(MProtocol_id); hopping_frequency_no=PELIKAN_NUM_RF_CHAN; packet_count=5; diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 443bb77..d601884 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -4,7 +4,7 @@ #endif #if not defined (ORANGE_TX) && not defined (STM32_BOARD) //Atmega328p - #if not defined(ARDUINO_AVR_PRO) && not defined(ARDUINO_MULTI_NO_BOOT) && not defined(ARDUINO_MULTI_FLASH_FROM_TX) && not defined(ARDUINO_AVR_MINI) && not defined(ARDUINO_AVR_NANO) + #if not defined(ARDUINO_AVR_PRO) && not defined(ARDUINO_MULTI_NO_BOOT) && not defined(ARDUINO_MULTI_FLASH_FROM_TX) && not defined(ARDUINO_AVR_MINI) && not defined(ARDUINO_AVR_NANO) && not defined(ARDUINO_AVR_DUEMILANOVE) #error You must select one of these boards: "Multi 4-in-1", "Arduino Pro or Pro Mini" or "Arduino Mini" #endif #if F_CPU != 16000000L || not defined(__AVR_ATmega328P__) From e35879a5d073d649ae46106635c5c44bcf25784f Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Sat, 1 Aug 2020 10:19:30 +0200 Subject: [PATCH 08/24] RadioLink: fix --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/RadioLink_cc2500.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 24d17d5..0512e19 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 49 +#define VERSION_PATCH_LEVEL 50 //****************** // Protocols diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index 93c0ed9..4e310d5 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -123,9 +123,9 @@ static void __attribute__((unused)) RLINK_init() { // channels order depend on ID and currently unknown so using a table of 64 entries... uint8_t id=rx_tx_addr[3]&0x3F; - RLINK_load_hopp(id); memcpy(rx_tx_addr,"\x4C\x49\x4E\x4B",RLINK_TX_ID_LEN); rx_tx_addr[0] += id; + RLINK_load_hopp(id); #ifdef RLINK_FORCE_ID //surface RC6GS From 3d98abb6d4361c593e1e466394ebcd638be1ed02 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Sat, 1 Aug 2020 19:19:11 +0200 Subject: [PATCH 09/24] Rename the Flyzone protocol by Height which is the original manufacturer --- Lua_scripts/MultiChan.txt | 4 +-- Multiprotocol/A7105_SPI.ino | 22 ++++++++-------- .../{Flyzone_a7105.ino => Height_a7105.ino} | 26 +++++++++---------- Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Names.ino | 8 +++--- Multiprotocol/Multiprotocol.h | 20 +++++++------- Multiprotocol/Multiprotocol.ino | 8 +++--- Multiprotocol/Validate.h | 12 ++++----- Multiprotocol/_Config.h | 10 +++---- Protocols_Details.md | 8 +++--- 10 files changed, 60 insertions(+), 60 deletions(-) rename Multiprotocol/{Flyzone_a7105.ino => Height_a7105.ino} (86%) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 5aeccab..c7a66e6 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -54,8 +54,8 @@ 28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -53,0,Flyzone,5ch,0,Gear -53,1,Flyzone,8ch,0,Gear,Gyro,Flap,Light +53,0,Height,5ch,0,Gear +53,1,Height,8ch,0,Gear,Gyro,Flap,Light 25,0,FrSkyV,V8,0,CH5,CH6,CH7,CH8 3,0,FrSkyD,D8,0,CH5,CH6,CH7,CH8 3,0,FrSkyD,D8Cloned,0,CH5,CH6,CH7,CH8 diff --git a/Multiprotocol/A7105_SPI.ino b/Multiprotocol/A7105_SPI.ino index 3399513..9703d50 100644 --- a/Multiprotocol/A7105_SPI.ino +++ b/Multiprotocol/A7105_SPI.ino @@ -192,9 +192,9 @@ void A7105_AdjustLOBaseFreq(uint8_t cmd) offset=(int16_t)FORCE_FLYSKY_TUNING; #endif break; - case PROTO_FLYZONE: - #ifdef FORCE_FLYZONE_TUNING - offset=(int16_t)FORCE_FLYZONE_TUNING; + case PROTO_HEIGHT: + #ifdef FORCE_HEIGHT_TUNING + offset=(int16_t)FORCE_HEIGHT_TUNING; #endif break; case PROTO_PELIKAN: @@ -287,8 +287,8 @@ const uint8_t PROGMEM FLYSKY_A7105_regs[] = { 0x01, 0x0f // 30 - 31 }; #endif -#ifdef FLYZONE_A7105_INO -const uint8_t PROGMEM FLYZONE_A7105_regs[] = { +#ifdef HEIGHT_A7105_INO +const uint8_t PROGMEM HEIGHT_A7105_regs[] = { 0xff, 0x42, 0x00, 0x07, 0x00, 0xff, 0xff ,0x00, 0x00, 0x00, 0x00, 0x01, 0x21, 0x05, 0x01, 0x50, // 00 - 0f 0x9e, 0x4b, 0x00, 0x02, 0x16, 0x2b, 0x12, 0x00, 0x62, 0x80, 0x80, 0x00, 0x0a, 0x32, 0xc3, 0x1f, // 10 - 1f 0x12, 0x00, 0x00, 0xff, 0x00, 0x00, 0x3a, 0x00, 0x3f, 0x47, 0x80, 0x03, 0x01, 0x45, 0x18, 0x00, // 20 - 2f @@ -327,10 +327,10 @@ void A7105_Init(void) uint8_t *A7105_Regs=0; uint8_t vco_calibration0, vco_calibration1; - #ifdef FLYZONE_A7105_INO - if(protocol==PROTO_FLYZONE) + #ifdef HEIGHT_A7105_INO + if(protocol==PROTO_HEIGHT) { - A7105_Regs=(uint8_t*)FLYZONE_A7105_regs; + A7105_Regs=(uint8_t*)HEIGHT_A7105_regs; A7105_WriteID(0x25A53C45); } else @@ -383,8 +383,8 @@ void A7105_Init(void) if(i==0x20) val=0x1E; } #endif - #ifdef FLYZONE_A7105_INO - if(protocol==PROTO_FLYZONE && sub_protocol==FLYZONE_8CH) + #ifdef HEIGHT_A7105_INO + if(protocol==PROTO_HEIGHT && sub_protocol==HEIGHT_8CH) if(i==0x03) val=0x0A; #endif if( val != 0xFF) @@ -441,7 +441,7 @@ void A7105_Init(void) case PROTO_FLYSKY: vco_calibration1=0x08; break; - case PROTO_FLYZONE: + case PROTO_HEIGHT: vco_calibration1=0x02; break; case PROTO_PELIKAN: diff --git a/Multiprotocol/Flyzone_a7105.ino b/Multiprotocol/Height_a7105.ino similarity index 86% rename from Multiprotocol/Flyzone_a7105.ino rename to Multiprotocol/Height_a7105.ino index 4a9714e..6377459 100644 --- a/Multiprotocol/Flyzone_a7105.ino +++ b/Multiprotocol/Height_a7105.ino @@ -14,16 +14,16 @@ */ // Compatible with FZ-410 TX -#if defined(FLYZONE_A7105_INO) +#if defined(HEIGHT_A7105_INO) #include "iface_a7105.h" -//#define FLYZONE_FORCEID +//#define HEIGHT_FORCEID -#define FLYZONE_BIND_COUNT 220 // 5 sec -#define FLYZONE_BIND_CH 0x18 // TX, RX for bind end is 0x17 +#define HEIGHT_BIND_COUNT 220 // 5 sec +#define HEIGHT_BIND_CH 0x18 // TX, RX for bind end is 0x17 -static void __attribute__((unused)) flyzone_build_packet() +static void __attribute__((unused)) HEIGHT_build_packet() { packet[0] = 0xA5; packet[1] = rx_tx_addr[2]; @@ -33,7 +33,7 @@ static void __attribute__((unused)) flyzone_build_packet() packet[5] = convert_channel_8b(THROTTLE); //00..FF packet[6] = convert_channel_8b(RUDDER); //00..80..FF packet[7] = convert_channel_8b(CH5); //00..80..FF - if(sub_protocol == FLYZONE_8CH) + if(sub_protocol == HEIGHT_8CH) { packet[8] = convert_channel_8b(CH6); //00..80..FF packet[9] = convert_channel_8b(CH7); //00..80..FF @@ -41,9 +41,9 @@ static void __attribute__((unused)) flyzone_build_packet() } } -uint16_t ReadFlyzone() +uint16_t ReadHeight() { - #ifndef FORCE_FLYZONE_TUNING + #ifndef FORCE_HEIGHT_TUNING A7105_AdjustLOBaseFreq(1); #endif if(IS_BIND_IN_PROGRESS) @@ -51,7 +51,7 @@ uint16_t ReadFlyzone() packet[0] = 0x1B; packet[1] = rx_tx_addr[2]; packet[2] = rx_tx_addr[3]; - A7105_WriteData(3, FLYZONE_BIND_CH); + A7105_WriteData(3, HEIGHT_BIND_CH); if (bind_counter--==0) BIND_DONE; return 22700; @@ -64,7 +64,7 @@ uint16_t ReadFlyzone() #ifdef MULTI_SYNC telemetry_set_input_sync(20*1500); #endif - flyzone_build_packet(); + HEIGHT_build_packet(); A7105_WriteData(sub_protocol?11:8, hopping_frequency[0]); A7105_SetPower(); } @@ -78,14 +78,14 @@ uint16_t ReadFlyzone() return 1500; } -uint16_t initFlyzone() +uint16_t initHeight() { A7105_Init(); hopping_frequency[0]=((random(0xfefefefe) & 0x0F)+2)<<2; hopping_frequency[1]=hopping_frequency[0]+0x50; - #ifdef FLYZONE_FORCEID + #ifdef HEIGHT_FORCEID rx_tx_addr[2]=0x35; rx_tx_addr[3]=0xD0; hopping_frequency[0]=0x18; @@ -93,7 +93,7 @@ uint16_t initFlyzone() #endif phase=255; - bind_counter = FLYZONE_BIND_COUNT; + bind_counter = HEIGHT_BIND_COUNT; return 2400; } #endif diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index ab5ffb9..9c5cd5f 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -50,7 +50,7 @@ 50,Redpine,Fast,Slow 51,Potensic,A20 52,ZSX,280 -53,Flyzone,5ch,8ch +53,Height,5ch,8ch 54,Scanner 55,Frsky_RX,RX,CloneTX 56,AFHDS2A_RX diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index 9cce375..8179bb2 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -72,7 +72,7 @@ const char STR_KF606[] ="KF606"; const char STR_REDPINE[] ="Redpine"; const char STR_POTENSIC[] ="Potensi"; const char STR_ZSX[] ="ZSX"; -const char STR_FLYZONE[] ="FlyZone"; +const char STR_HEIGHT[] ="Height"; const char STR_SCANNER[] ="Scanner"; const char STR_FRSKY_RX[] ="FrSkyRX"; const char STR_AFHDS2A_RX[] ="FS2A_RX"; @@ -125,7 +125,7 @@ const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2"; const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow"; const char STR_SUBTYPE_POTENSIC[] = "\x03""A20"; const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC"; -const char STR_SUBTYPE_FLYZONE[] = "\x03""5ch""8ch"; +const char STR_SUBTYPE_HEIGHT[] = "\x03""5ch""8ch"; const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ""NRF\0 "; const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch"; @@ -224,8 +224,8 @@ const mm_protocol_definition multi_protocols[] = { #if defined(AFHDS2A_RX_A7105_INO) {PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,0, NO_SUBTYPE, OPTION_NONE }, #endif - #if defined(FLYZONE_A7105_INO) - {PROTO_FLYZONE, STR_FLYZONE, 2, STR_SUBTYPE_FLYZONE, OPTION_NONE }, + #if defined(HEIGHT_A7105_INO) + {PROTO_HEIGHT, STR_HEIGHT, 2, STR_SUBTYPE_HEIGHT, OPTION_NONE }, #endif #if defined(FQ777_NRF24L01_INO) {PROTO_FQ777, STR_FQ777, 0, NO_SUBTYPE, OPTION_NONE }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 0512e19..1baa351 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 50 +#define VERSION_PATCH_LEVEL 49 //****************** // Protocols @@ -79,7 +79,7 @@ enum PROTOCOLS PROTO_REDPINE = 50, // =>CC2500 PROTO_POTENSIC = 51, // =>NRF24L01 PROTO_ZSX = 52, // =>NRF24L01 - PROTO_FLYZONE = 53, // =>A7105 + PROTO_HEIGHT = 53, // =>A7105 PROTO_SCANNER = 54, // =>CC2500 PROTO_FRSKY_RX = 55, // =>CC2500 PROTO_AFHDS2A_RX= 56, // =>A7105 @@ -114,7 +114,7 @@ enum Flysky V912 = 3, CX20 = 4, }; -enum Flyzone +enum Height { FZ410 = 0, }; @@ -390,10 +390,10 @@ enum V761 V761_4CH = 1, }; -enum FLYZONE +enum HEIGHT { - FLYZONE_5CH = 0, - FLYZONE_8CH = 1, + HEIGHT_5CH = 0, + HEIGHT_8CH = 1, }; #define NONE 0 @@ -787,7 +787,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- REDPINE 50 POTENSIC 51 ZSX 52 - FLYZONE 53 + HEIGHT 53 SCANNER 54 FRSKY_RX 55 AFHDS2A_RX 56 @@ -999,9 +999,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- sub_protocol==V761 V761_3CH 0 V761_4CH 1 - sub_protocol==FLYZONE - FLYZONE_5CH 0 - FLYZONE_8CH 1 + sub_protocol==HEIGHT + HEIGHT_5CH 0 + HEIGHT_8CH 1 Power value => 0x80 0=High/1=Low Stream[3] = option_protocol; diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 254ef67..e413b4a 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1120,11 +1120,11 @@ static void protocol_init() remote_callback = ReadBUGS; break; #endif - #if defined(FLYZONE_A7105_INO) - case PROTO_FLYZONE: + #if defined(HEIGHT_A7105_INO) + case PROTO_HEIGHT: PE1_off; //antenna RF1 - next_callback = initFlyzone(); - remote_callback = ReadFlyzone; + next_callback = initHeight(); + remote_callback = ReadHeight; break; #endif #if defined(AFHDS2A_RX_A7105_INO) diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index d601884..d6d99e4 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -140,9 +140,9 @@ #error "The Flysky forced frequency tuning value is outside of the range -300..300." #endif #endif -#ifdef FORCE_FLYZONE_TUNING - #if ( FORCE_FLYZONE_TUNING < -300 ) || ( FORCE_FLYZONE_TUNING > 300 ) - #error "The Flyzone forced frequency tuning value is outside of the range -300..300." +#ifdef FORCE_HEIGHT_TUNING + #if ( FORCE_HEIGHT_TUNING < -300 ) || ( FORCE_HEIGHT_TUNING > 300 ) + #error "The Height forced frequency tuning value is outside of the range -300..300." #endif #endif #ifdef FORCE_PELIKAN_TUNING @@ -168,8 +168,8 @@ #ifndef FORCE_FLYSKY_TUNING #define FORCE_FLYSKY_TUNING 0 #endif - #ifndef FORCE_FLYZONE_TUNING - #define FORCE_FLYZONE_TUNING 0 + #ifndef FORCE_HEIGHT_TUNING + #define FORCE_HEIGHT_TUNING 0 #endif #ifndef FORCE_PELIKAN_TUNING #define FORCE_PELIKAN_TUNING 0 @@ -223,7 +223,7 @@ #undef AFHDS2A_RX_A7105_INO #undef BUGS_A7105_INO #undef FLYSKY_A7105_INO - #undef FLYZONE_A7105_INO + #undef HEIGHT_A7105_INO #undef HUBSAN_A7105_INO #undef KYOSHO_A7105_INO #undef PELIKAN_A7105_INO diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 713c4f2..8575f0b 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -118,7 +118,7 @@ //#define FORCE_AFHDS2A_TUNING 0 //#define FORCE_BUGS_TUNING 0 //#define FORCE_FLYSKY_TUNING 0 -//#define FORCE_FLYZONE_TUNING 0 +//#define FORCE_HEIGHT_TUNING 0 //#define FORCE_HUBSAN_TUNING 0 //#define FORCE_KYOSHO_TUNING 0 //#define FORCE_PELIKAN_TUNING 0 @@ -170,7 +170,7 @@ #define AFHDS2A_RX_A7105_INO #define BUGS_A7105_INO #define FLYSKY_A7105_INO -#define FLYZONE_A7105_INO +#define HEIGHT_A7105_INO #define HUBSAN_A7105_INO #define KYOSHO_A7105_INO #define PELIKAN_A7105_INO @@ -580,9 +580,6 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { V6X6 V912 CX20 - PROTO_FLYZONE - FLYZONE_5CH - FLYZONE_8CH PROTO_FQ777 NONE PROTO_FRSKY_RX @@ -636,6 +633,9 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { H20H H20MINI H30MINI + PROTO_HEIGHT + HEIGHT_5CH + HEIGHT_8CH PROTO_HISKY Hisky HK310 diff --git a/Protocols_Details.md b/Protocols_Details.md index 7281342..11d3912 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -83,7 +83,6 @@ CFlie|38|CFlie||||||||NRF24L01| [Flysky](Protocols_Details.md#FLYSKY---1)|1|Flysky|V9x9|V6x6|V912|CX20||||A7105| [Flysky AFHDS2A](Protocols_Details.md#FLYSKY-AFHDS2A---28)|28|PWM_IBUS|PPM_IBUS|PWM_SBUS|PPM_SBUS|PWM_IBUS16|PPM_IBUS16|||A7105| [Flysky AFHDS2A RX](Protocols_Details.md#FLYSKY-AFHDS2A-RX---56)|56|RX||||||||A7105| -[Flyzone](Protocols_Details.md#FLYZONE---53)|53|FZ410||||||||A7105| [FQ777](Protocols_Details.md#FQ777---23)|23|FQ777||||||||NRF24L01|SSV7241 [FrskyD](Protocols_Details.md#FRSKYD---3)|3|D8|Cloned|||||||CC2500| [FrskyL](Protocols_Details.md#FRSKYL---67)|67|LR12|LR12 6CH|||||||CC2500| @@ -97,6 +96,7 @@ CFlie|38|CFlie||||||||NRF24L01| [GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01| [GW008](Protocols_Details.md#GW008---32)|32|GW008||||||||NRF24L01|XN297 [H8_3D](Protocols_Details.md#H8_3D---36)|36|H8_3D|H20H|H20Mini|H30Mini|||||NRF24L01|XN297 +[Height](Protocols_Details.md#HEIGHT---53)|53|5ch|8ch|||||||A7105| [Hisky](Protocols_Details.md#HISKY---4)|4|Hisky|HK310|||||||NRF24L01| [Hitec](Protocols_Details.md#HITEC---39)|39|OPT_FW|OPT_HUB|MINIMA||||||CC2500| [Hontai](Protocols_Details.md#HONTAI---26)|26|HONTAI|JJRCX1|X5C1|FQ777_951|||||NRF24L01|XN297 @@ -239,17 +239,17 @@ Extended limits supported Low power: enable/disable the LNA stage on the RF component to use depending on the distance with the TX. -## FLYZONE - *53* +## HEIGHT - *53* ### Sub_protocol 5CH - *0* -Models using the Flyzone FZ-410 TX: Fokker D.VII Micro EP RTF. Models using the old ARES TX (prior to Hitec RED) Tiger Moth, eRC Micro Stick and Rage R/C. +Models from Height, Flyzone, Rage R/C, eRC and the old ARES (prior to Hitec RED). CH1|CH2|CH3|CH4|CH5 ---|---|---|---|--- A|E|T|R|Gear ### Sub_protocol 8CH - *1* -Models using the new 8 channels radio Flyzone, eRC and Rage R/C. +Models from Height and Rage R/C. CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8 ---|---|---|---|---|---|---|--- From 5f12f99761de818878e3a06541be41ef938947fb Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Sat, 1 Aug 2020 19:35:39 +0200 Subject: [PATCH 10/24] Update Validate.h --- Multiprotocol/Validate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index d6d99e4..30e1dae 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -7,7 +7,7 @@ #if not defined(ARDUINO_AVR_PRO) && not defined(ARDUINO_MULTI_NO_BOOT) && not defined(ARDUINO_MULTI_FLASH_FROM_TX) && not defined(ARDUINO_AVR_MINI) && not defined(ARDUINO_AVR_NANO) && not defined(ARDUINO_AVR_DUEMILANOVE) #error You must select one of these boards: "Multi 4-in-1", "Arduino Pro or Pro Mini" or "Arduino Mini" #endif - #if F_CPU != 16000000L || not defined(__AVR_ATmega328P__) + #if F_CPU != 16000000L || not (defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)) #error You must select the processor type "ATmega328(5V, 16MHz)" #endif #endif From fdd357619b8f2d46227f9f60f1426100cafc5470 Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Mon, 3 Aug 2020 21:37:07 +0100 Subject: [PATCH 11/24] Fix folder structure inside LUA script zip file --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4354623..8d82629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,10 +49,10 @@ before_install: exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin; cp Multiprotocol/Multi.txt ./binaries/Multi.txt; - mkdir -p TOOLS/SCRIPTS; - cp Lua_scripts/*.lua TOOLS/SCRIPTS/; - cp Lua_scripts/*.txt TOOLS/SCRIPTS/; - zip ./binaries/MultiLuaScripts.zip TOOLS/SCRIPTS/*; + mkdir -p SCRIPTS/TOOLS; + cp Lua_scripts/*.lua SCRIPTS/TOOLS/; + cp Lua_scripts/*.txt SCRIPTS/TOOLS/; + zip ./binaries/MultiLuaScripts.zip SCRIPTS/TOOLS/*; return $exitcode; }; elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then buildReleaseFiles(){ From 660282db2e100835aa56b766c3d7510a95f020e4 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Tue, 4 Aug 2020 10:42:35 +0200 Subject: [PATCH 12/24] RX protocols: abort RX bind as requested --- Multiprotocol/AFHDS2A_Rx_a7105.ino | 4 ++++ Multiprotocol/Bayang_Rx_nrf24l01.ino | 1 + Multiprotocol/FrSky_Rx_cc2500.ino | 2 ++ Multiprotocol/Multiprotocol.h | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/AFHDS2A_Rx_a7105.ino b/Multiprotocol/AFHDS2A_Rx_a7105.ino index c90c1d5..1c4cc51 100644 --- a/Multiprotocol/AFHDS2A_Rx_a7105.ino +++ b/Multiprotocol/AFHDS2A_Rx_a7105.ino @@ -104,6 +104,7 @@ uint16_t AFHDS2A_Rx_callback() switch(phase) { case AFHDS2A_RX_BIND1: + if(IS_BIND_DONE) return initAFHDS2A_Rx(); // Abort bind if (AFHDS2A_Rx_data_ready()) { A7105_ReadData(AFHDS2A_RX_TXPACKET_SIZE); if ((packet[0] == 0xbb && packet[9] == 0x01) || (packet[0] == 0xbc && packet[9] <= 0x02)) { @@ -118,6 +119,7 @@ uint16_t AFHDS2A_Rx_callback() return 10000; case AFHDS2A_RX_BIND2: + if(IS_BIND_DONE) return initAFHDS2A_Rx(); // Abort bind // got 2nd bind packet from tx ? if (AFHDS2A_Rx_data_ready()) { A7105_ReadData(AFHDS2A_RX_TXPACKET_SIZE); @@ -143,6 +145,7 @@ uint16_t AFHDS2A_Rx_callback() packet[9] = 0x01; packet[10] = 0x00; memset(&packet[11], 0xFF, 26); + A7105_SetTxRxMode(TX_EN); A7105_WriteData(AFHDS2A_RX_RXPACKET_SIZE, packet_count++ & 1 ? 0x0D : 0x8C); phase |= AFHDS2A_RX_WAIT_WRITE; return 1700; @@ -153,6 +156,7 @@ uint16_t AFHDS2A_Rx_callback() while (micros() - pps_timer < 700) // Wait max 700µs, using serial+telemetry exit in about 120µs if (!(A7105_ReadReg(A7105_00_MODE) & 0x01)) break; + A7105_SetTxRxMode(RX_EN); A7105_Strobe(A7105_RX); phase &= ~AFHDS2A_RX_WAIT_WRITE; return 10000; diff --git a/Multiprotocol/Bayang_Rx_nrf24l01.ino b/Multiprotocol/Bayang_Rx_nrf24l01.ino index 31197b6..d85230f 100644 --- a/Multiprotocol/Bayang_Rx_nrf24l01.ino +++ b/Multiprotocol/Bayang_Rx_nrf24l01.ino @@ -129,6 +129,7 @@ uint16_t Bayang_Rx_callback() switch (phase) { case BAYANG_RX_BIND: + if(IS_BIND_DONE) return initBayang_Rx(); // Abort bind if (NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR)) { // data received from TX if (XN297_ReadPayload(packet, BAYANG_RX_PACKET_SIZE) && ( packet[0] == 0xA4 || packet[0] == 0xA2 ) && Bayang_Rx_check_validity()) { diff --git a/Multiprotocol/FrSky_Rx_cc2500.ino b/Multiprotocol/FrSky_Rx_cc2500.ino index 47bcc06..0ca6ac9 100644 --- a/Multiprotocol/FrSky_Rx_cc2500.ino +++ b/Multiprotocol/FrSky_Rx_cc2500.ino @@ -383,6 +383,8 @@ uint16_t FrSky_Rx_callback() static int8_t tune_low, tune_high; uint8_t len, ch; + if(IS_BIND_DONE && phase != FRSKY_RX_DATA) return initFrSky_Rx(); // Abort bind + if ((prev_option != option) && (phase >= FRSKY_RX_DATA)) { if (option == 0) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 1baa351..96149d9 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 49 +#define VERSION_PATCH_LEVEL 50 //****************** // Protocols From aa5fd82004db3bfd0bc2dbfefdd985911c413d5d Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Wed, 5 Aug 2020 09:50:40 +0200 Subject: [PATCH 13/24] Update FrSky_Rx_cc2500.ino --- Multiprotocol/FrSky_Rx_cc2500.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/FrSky_Rx_cc2500.ino b/Multiprotocol/FrSky_Rx_cc2500.ino index 0ca6ac9..0bfa84d 100644 --- a/Multiprotocol/FrSky_Rx_cc2500.ino +++ b/Multiprotocol/FrSky_Rx_cc2500.ino @@ -358,7 +358,6 @@ static void __attribute__((unused)) frsky_rx_data() uint16_t initFrSky_Rx() { - state = 0; frsky_rx_chanskip = 1; hopping_frequency_no = 0; rx_data_started = false; @@ -414,6 +413,7 @@ uint16_t FrSky_Rx_callback() phase = FRSKY_RX_TUNE_LOW; debugln("FRSKY_RX_TUNE_LOW"); frsky_rx_strobe_rx(); + state = 0; return 1000; } } @@ -485,7 +485,7 @@ uint16_t FrSky_Rx_callback() } } else - state=0x3FF; //No hop table for D16v2 + state = 0x3FF; //No hop table for D16v2 if (state == 0x3FF) { debugln("Bind complete"); From 2178f6761ded9ef8445a5c6fa7cb6ea5333af559 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 7 Aug 2020 15:11:59 +0200 Subject: [PATCH 14/24] RadioLink: update A2=Batt telemetry value --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/RadioLink_cc2500.ino | 2 +- Protocols_Details.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 96149d9..59b0051 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 50 +#define VERSION_PATCH_LEVEL 51 //****************** // Protocols diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index 4e310d5..b022223 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -297,7 +297,7 @@ uint16_t RLINK_callback() TX_RSSI += 128; RX_RSSI=packet_in[7]; //Should be packet_in[7]-256 but since it's an uint8_t... v_lipo1=packet_in[8]<<1; //RX Batt - v_lipo2=packet_in[9]<<1; //Batt + v_lipo2=packet_in[9]; //Batt telemetry_link=1; //Send telemetry out pps_counter++; packet_count=0; diff --git a/Protocols_Details.md b/Protocols_Details.md index 11d3912..ac88d3f 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -573,7 +573,7 @@ Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM, CH1=Steering, CH2=Throttle, CH8=Gyro gain -Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt +Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt/2 (adjust the ratio) ### Sub_protocol Air - *1* Air protocol. TXs: T8FB,T8S. Compatible RXs:R8EF,R8FM,R8SM,R4FG,R4F and more From 708e2ac5f6fa0fb38585cacf5f9038aaf4e9bade Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 7 Aug 2020 15:18:15 +0200 Subject: [PATCH 15/24] V761 bug fix: the model was not reconnecting unless you did a bind first --- Multiprotocol/V761_nrf24l01.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Multiprotocol/V761_nrf24l01.ino b/Multiprotocol/V761_nrf24l01.ino index f29b581..3f908b9 100644 --- a/Multiprotocol/V761_nrf24l01.ino +++ b/Multiprotocol/V761_nrf24l01.ino @@ -166,7 +166,9 @@ static void __attribute__((unused)) V761_initialize_txid() memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",3); break; } + //rx_tx_addr[0]+=RX_num; hopping_frequency[2]=hopping_frequency[0]+0x37; + debugln("ID: %02X %02X %02X %02X , HOP: %02X %02X %02X",rx_tx_addr[0],rx_tx_addr[1],rx_tx_addr[2],rx_tx_addr[3],hopping_frequency[0],hopping_frequency[1],hopping_frequency[2]); } uint16_t V761_callback() @@ -223,7 +225,11 @@ uint16_t initV761(void) phase = V761_BIND1; } else + { + XN297_SetTXAddr(rx_tx_addr, 4); phase = V761_DATA; + } + V761_init(); hopping_frequency_no = 0; packet_count = 0; From 6810372064ecc4076263651e241534f15bb199c0 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 10 Aug 2020 20:30:19 +0200 Subject: [PATCH 16/24] RadioLink: enable Range test mode --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/RadioLink_cc2500.ino | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 59b0051..4549162 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 51 +#define VERSION_PATCH_LEVEL 52 //****************** // Protocols diff --git a/Multiprotocol/RadioLink_cc2500.ino b/Multiprotocol/RadioLink_cc2500.ino index b022223..9334379 100644 --- a/Multiprotocol/RadioLink_cc2500.ino +++ b/Multiprotocol/RadioLink_cc2500.ino @@ -166,7 +166,6 @@ static void __attribute__((unused)) RLINK_rf_init() CC2500_WriteReg(CC2500_0C_FSCTRL0, option); CC2500_SetTxRxMode(TX_EN); - CC2500_SetPower(); } static void __attribute__((unused)) RLINK_tune_freq() @@ -178,7 +177,7 @@ static void __attribute__((unused)) RLINK_tune_freq() } } -static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet() +static void __attribute__((unused)) RLINK_send_packet() { static uint32_t pseudo=0; uint32_t bits = 0; @@ -262,8 +261,9 @@ uint16_t RLINK_callback() #ifdef MULTI_SYNC telemetry_set_input_sync(RLINK_TIMING_PROTO); #endif + CC2500_SetPower(); RLINK_tune_freq(); - RLINK_TIMING_RFSEND_packet(); + RLINK_send_packet(); #if not defined RLINK_HUB_TELEMETRY return RLINK_TIMING_PROTO; #else From 14084316492d8df85b799b847111ab06eb960204 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 10 Aug 2020 22:52:50 +0200 Subject: [PATCH 17/24] XN297Dump: increase the number of RF channels to look for --- Multiprotocol/XN297Dump_nrf24l01.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiprotocol/XN297Dump_nrf24l01.ino b/Multiprotocol/XN297Dump_nrf24l01.ino index d10cf89..89ebfdb 100644 --- a/Multiprotocol/XN297Dump_nrf24l01.ino +++ b/Multiprotocol/XN297Dump_nrf24l01.ino @@ -23,7 +23,7 @@ // Parameters which can be modified #define XN297DUMP_PERIOD_SCAN 50000 // 25000 -#define XN297DUMP_MAX_RF_CHANNEL 84 // Default 84 +#define XN297DUMP_MAX_RF_CHANNEL 127 // Default 84 // Do not touch from there #define XN297DUMP_INITIAL_WAIT 500 From ea24ab6032223bb89bf300e5c1b3631bb76ff8cf Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 10 Aug 2020 23:54:33 +0200 Subject: [PATCH 18/24] New protocol Realacc --- Lua_scripts/MultiChan.txt | 5 +- Multiprotocol/Multi.txt | 3 +- Multiprotocol/Multi_Names.ino | 11 +- Multiprotocol/Multiprotocol.h | 4 +- Multiprotocol/Multiprotocol.ino | 6 ++ Multiprotocol/REALACC_nrf24l01.ino | 157 +++++++++++++++++++++++++++++ Multiprotocol/Validate.h | 1 + Multiprotocol/_Config.h | 3 + 8 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 Multiprotocol/REALACC_nrf24l01.ino diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index c7a66e6..4a2c3d0 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -135,10 +135,11 @@ 31,2,Q303,CX10D,1,Arm,Flip 31,3,Q303,CX10WD,1,Arm,Flip 72,0,Q90C,Std,0,FMode,VTX+ -50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 +76,0,Realacc,R11,1,Flip,Light,Calib,HLess,RTH,UNK +50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 +50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 21,0,SFHSS,Std,0,CH5,CH6,CH7,CH8 19,0,Shenqi,Cycle,1 68,0,Skyartec,Std,0,CH5,CH6,CH7 diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index 9c5cd5f..4afa60c 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -71,4 +71,5 @@ 71,JJRC345 72,Q90C 73,Kyosho -74,RadioLink,Surface \ No newline at end of file +74,RadioLink,Surface +76,Realacc,R11 \ No newline at end of file diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index 8179bb2..99b2714 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -88,6 +88,7 @@ const char STR_PROPEL[] ="Propel"; const char STR_SKYARTEC[] ="Skyartc"; const char STR_KYOSHO[] ="Kyosho"; const char STR_RLINK[] ="RadLink"; +const char STR_REALACC[] ="Realacc"; const char STR_TEST[] ="Test"; const char STR_FAKE[] ="Fake"; @@ -142,6 +143,7 @@ const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync"; const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite"; const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch"; const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 "; +const char STR_SUBTYPE_REALACC[] = "\x03""R11"; enum { @@ -323,12 +325,15 @@ const mm_protocol_definition multi_protocols[] = { #if defined(Q90C_NRF24L01_INO) {PROTO_Q90C, STR_Q90C, 0, NO_SUBTYPE, OPTION_RFTUNE }, #endif - #if defined(REDPINE_CC2500_INO) - {PROTO_REDPINE, STR_REDPINE, 2, STR_SUBTYPE_REDPINE, OPTION_RFTUNE }, - #endif #if defined(RLINK_CC2500_INO) {PROTO_RLINK, STR_RLINK, 2, STR_SUBTYPE_RLINK, OPTION_RFTUNE }, #endif + #if defined(REALACC_NRF24L01_INO) + {PROTO_REALACC, STR_REALACC, 1, STR_SUBTYPE_REALACC, OPTION_NONE }, + #endif + #if defined(REDPINE_CC2500_INO) + {PROTO_REDPINE, STR_REDPINE, 2, STR_SUBTYPE_REDPINE, OPTION_RFTUNE }, + #endif #if defined(SCANNER_CC2500_INO) // {PROTO_SCANNER, STR_SCANNER, 0, NO_SUBTYPE, OPTION_NONE }, #endif diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 4549162..c22f2e4 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 52 +#define VERSION_PATCH_LEVEL 53 //****************** // Protocols @@ -101,6 +101,7 @@ enum PROTOCOLS PROTO_Q90C = 72, // =>NRF24L01 or CC2500 PROTO_KYOSHO = 73, // =>A7105 PROTO_RLINK = 74, // =>CC2500 + PROTO_REALACC = 76, // =>NRF24L01 PROTO_FAKE = 126, // =>CC2500+NRF24L01 PROTO_TEST = 127, // =>CC2500 @@ -809,6 +810,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- Q90C 72 KYOSHO 73 RLINK 74 + REALACC 76 BindBit=> 0x80 1=Bind/0=No AutoBindBit=> 0x40 1=Yes /0=No RangeCheck=> 0x20 1=Yes /0=No diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index e413b4a..b255c86 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1598,6 +1598,12 @@ static void protocol_init() remote_callback = Q90C_callback; break; #endif + #if defined(REALACC_NRF24L01_INO) + case PROTO_REALACC: + next_callback=initREALACC(); + remote_callback = REALACC_callback; + break; + #endif #if defined(TEST_CC2500_INO) case PROTO_TEST: next_callback=initTEST(); diff --git a/Multiprotocol/REALACC_nrf24l01.ino b/Multiprotocol/REALACC_nrf24l01.ino new file mode 100644 index 0000000..79cfe4b --- /dev/null +++ b/Multiprotocol/REALACC_nrf24l01.ino @@ -0,0 +1,157 @@ +/* + This project is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +Multiprotocol is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Multiprotocol. If not, see . + */ +// Compatible with Realacc R11 + +#if defined(REALACC_NRF24L01_INO) + +#include "iface_nrf24l01.h" + +#define FORCE_REALACC_ORIGINAL_ID + +#define REALACC_INITIAL_WAIT 500 +#define REALACC_PACKET_PERIOD 2268 +#define REALACC_BIND_RF_CHANNEL 80 +#define REALACC_BIND_PAYLOAD_SIZE 10 +#define REALACC_PAYLOAD_SIZE 13 +#define REALACC_BIND_COUNT 50 +#define REALACC_RF_NUM_CHANNELS 5 + +static void __attribute__((unused)) REALACC_send_packet() +{ + packet[ 0]= 0xDC; + packet[ 1]= convert_channel_8b(AILERON); // 00..80..FF + packet[ 2]= convert_channel_8b(ELEVATOR); // 00..80..FF + packet[ 3]= convert_channel_8b(THROTTLE); // 00..FF + packet[ 4]= convert_channel_8b(RUDDER); // 00..80..FF + packet[ 5]= 0x20; // Trim + packet[ 6]= 0x20; // Trim + packet[ 7]= 0x20; // Trim + packet[ 8]= 0x20; // Trim + packet[ 9]= num_ch; // Change at each power up + packet[10]= 0x04 // Flag1 + | 0x02 // Rate1=0, Rate2=1, Rate3=2 + | GET_FLAG(CH8_SW, 0x20); // Headless + packet[11]= 0x00 // Flag2 + | GET_FLAG(CH7_SW, 0x01) // Calib + | GET_FLAG(CH9_SW, 0x20) // Return + | GET_FLAG(CH10_SW,0x80); // Unknown + packet[12]= 0x00 // Flag3 + | GET_FLAG(CH5_SW, 0x01) // Flip + | GET_FLAG(CH6_SW, 0x80); // Light + + NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency_no); + hopping_frequency_no++; + hopping_frequency_no %= REALACC_RF_NUM_CHANNELS; + XN297_WritePayload(packet, REALACC_PAYLOAD_SIZE); +} + +static void __attribute__((unused)) REALACC_send_bind_packet() +{ + packet[0] = 0xB1; + memcpy(&packet[1],rx_tx_addr,4); + memcpy(&packet[5],hopping_frequency,5); + + XN297_WritePayload(packet, REALACC_BIND_PAYLOAD_SIZE); +} + +static void __attribute__((unused)) REALACC_initialize_txid() +{ + calc_fh_channels(REALACC_RF_NUM_CHANNELS); + num_ch=random(0xfefefefe); // 00..FF + + #ifdef FORCE_REALACC_ORIGINAL_ID + //Dump + rx_tx_addr[0]=0x99; + rx_tx_addr[1]=0x06; + rx_tx_addr[2]=0x00; + rx_tx_addr[3]=0x00; + hopping_frequency[0]=0x55; + hopping_frequency[1]=0x59; + hopping_frequency[2]=0x5A; + hopping_frequency[3]=0x5A; + hopping_frequency[4]=0x62; + num_ch=0xC5; // Value in dumps: C5 A2 77 F0 84 58 + #endif +} + +static void __attribute__((unused)) REALACC_init() +{ + NRF24L01_Initialize(); + NRF24L01_SetTxRxMode(TX_EN); + NRF24L01_FlushTx(); + NRF24L01_FlushRx(); + NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit + NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes + NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01); // Enable data pipe 0 only + NRF24L01_SetBitrate(NRF24L01_BR_1M); // 1Mbps + NRF24L01_SetPower(); + XN297_SetTXAddr((uint8_t*)"MAIN", 4); + NRF24L01_WriteReg(NRF24L01_05_RF_CH, REALACC_BIND_RF_CHANNEL); // Set bind channel +} + +uint16_t REALACC_callback() +{ + #ifdef MULTI_SYNC + telemetry_set_input_sync(REALACC_PACKET_PERIOD); + #endif + XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP)); + NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); + NRF24L01_FlushTx(); + NRF24L01_SetPower(); + if(IS_BIND_IN_PROGRESS) + { + REALACC_send_bind_packet(); + if(--bind_counter==0) + { + BIND_DONE; + XN297_SetTXAddr(rx_tx_addr, 4); + } + } + else + REALACC_send_packet(); + return REALACC_PACKET_PERIOD; +} + +uint16_t initREALACC() +{ + BIND_IN_PROGRESS; // autobind protocol + REALACC_initialize_txid(); + REALACC_init(); + bind_counter=REALACC_BIND_COUNT; + hopping_frequency_no=0; + return REALACC_INITIAL_WAIT; +} + +#endif + +// XN297 speed 1Mb, scrambled, enhanced +// Bind +// Address = 4D 41 49 4E = 'MAIN' +// Channel = 80 (most likely from dump) +// P(10) = B1 99 06 00 00 55 59 5A 5A 62 +// B1 indicates bind packet +// 99 06 00 00 = ID = address of normal packets +// 55 59 5A 5A 62 = 85, 89, 90, 90, 98 = RF channels to be used (kind of match previous dumps)// Normal +// Normal +// Address = 99 06 00 00 +// Channels = 84, 89, 90, 90, 98 (guess from bind) +// P(13)= DC 80 80 32 80 20 20 20 20 58 04 00 00 +// DC = normal packet +// 80 80 32 80 : AETR 00..80..FF +// 20 20 20 20 : Trims +// 58 : changing every time the TX restart +// 04 : |0x20=headless, |0x01=rate2, |0x02=rate3 +// 00 : |0x01=calib, |0x20=return, |0x80=unknown +// 00 : |0x80=light, |0x01=flip \ No newline at end of file diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 30e1dae..6e48cb5 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -285,6 +285,7 @@ #undef PROPEL_NRF24L01_INO #undef Q303_NRF24L01_INO #undef Q90C_NRF24L01_INO + #undef REALACC_NRF24L01_INO #undef SHENQI_NRF24L01_INO #undef SLT_NRF24L01_INO #undef SYMAX_NRF24L01_INO diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 8575f0b..469e45f 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -231,6 +231,7 @@ #define PROPEL_NRF24L01_INO #define Q303_NRF24L01_INO #define Q90C_NRF24L01_INO +#define REALACC_NRF24L01_INO #define SHENQI_NRF24L01_INO #define SLT_NRF24L01_INO #define SYMAX_NRF24L01_INO @@ -700,6 +701,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { CX10WD PROTO_Q90C NONE + PROTO_REALACC + NONE PROTO_REDPINE RED_FAST RED_SLOW From 3789998ba9dd3649267b8a67c7a07ebd1a8fcc4c Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 10 Aug 2020 23:54:51 +0200 Subject: [PATCH 19/24] Update ZSX_nrf24l01.ino --- Multiprotocol/ZSX_nrf24l01.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiprotocol/ZSX_nrf24l01.ino b/Multiprotocol/ZSX_nrf24l01.ino index 23b55a0..454a6cd 100644 --- a/Multiprotocol/ZSX_nrf24l01.ino +++ b/Multiprotocol/ZSX_nrf24l01.ino @@ -16,7 +16,7 @@ Multiprotocol is distributed in the hope that it will be useful, #if defined(ZSX_NRF24L01_INO) -#include "iface_nrf250k.h" +#include "iface_nrf24l01.h" //#define FORCE_ZSX_ORIGINAL_ID From 030cdd35a226b33d8d578f978b760e5a7344c56d Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Tue, 11 Aug 2020 00:02:19 +0200 Subject: [PATCH 20/24] Update REALACC_nrf24l01.ino --- Multiprotocol/REALACC_nrf24l01.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/REALACC_nrf24l01.ino b/Multiprotocol/REALACC_nrf24l01.ino index 79cfe4b..eff18e2 100644 --- a/Multiprotocol/REALACC_nrf24l01.ino +++ b/Multiprotocol/REALACC_nrf24l01.ino @@ -54,7 +54,7 @@ static void __attribute__((unused)) REALACC_send_packet() NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency_no); hopping_frequency_no++; hopping_frequency_no %= REALACC_RF_NUM_CHANNELS; - XN297_WritePayload(packet, REALACC_PAYLOAD_SIZE); + XN297_WriteEnhancedPayload(packet, REALACC_PAYLOAD_SIZE,0); } static void __attribute__((unused)) REALACC_send_bind_packet() @@ -63,7 +63,7 @@ static void __attribute__((unused)) REALACC_send_bind_packet() memcpy(&packet[1],rx_tx_addr,4); memcpy(&packet[5],hopping_frequency,5); - XN297_WritePayload(packet, REALACC_BIND_PAYLOAD_SIZE); + XN297_WriteEnhancedPayload(packet, REALACC_BIND_PAYLOAD_SIZE,1); } static void __attribute__((unused)) REALACC_initialize_txid() From 8b189af2f9ae34ea46f23de835297bbc64a155f8 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Thu, 13 Aug 2020 21:21:34 +0200 Subject: [PATCH 21/24] R9: small change --- Multiprotocol/FrSkyR9_sx1276.ino | 7 ++++--- Multiprotocol/Multiprotocol.h | 34 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Multiprotocol/FrSkyR9_sx1276.ino b/Multiprotocol/FrSkyR9_sx1276.ino index 057e303..02d4882 100644 --- a/Multiprotocol/FrSkyR9_sx1276.ino +++ b/Multiprotocol/FrSkyR9_sx1276.ino @@ -207,7 +207,8 @@ uint16_t initFrSkyR9() SX1276_SetHopPeriod(0); // 0 = disabled, we hop frequencies manually SX1276_SetPaDac(true); SX1276_SetTxRxMode(TX_EN); // Set RF switch to TX - + //Enable all IRQ flags + SX1276_WriteReg(SX1276_11_IRQFLAGSMASK,0x00); FrSkyX_telem_init(); hopping_frequency_no=0; @@ -256,6 +257,8 @@ uint16_t FrSkyR9_callback() SX1276_WriteReg(SX1276_0D_FIFOADDRPTR, 0x00); //Set RF switch to RX SX1276_SetTxRxMode(RX_EN); + //Clear all IRQ flags + SX1276_WriteReg(SX1276_12_REGIRQFLAGS,0xFF); //Switch to RX SX1276_WriteReg(SX1276_01_OPMODE, 0x85); phase++; @@ -294,8 +297,6 @@ uint16_t FrSkyR9_callback() FrSkyX_telem_init(); // Reset telemetry else telemetry_link=1; // Send telemetry out anyway - //Clear all flags - SX1276_WriteReg(SX1276_12_REGIRQFLAGS,0xFF); phase=FRSKYR9_FREQ; break; #endif diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index c22f2e4..43945c5 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 53 +#define VERSION_PATCH_LEVEL 54 //****************** // Protocols @@ -603,17 +603,17 @@ enum { }; // A7105 power -// Power amp is ~+16dBm so: +// The numbers do not take into account any outside amplifier enum A7105_POWER { - A7105_POWER_0 = 0x00<<3 | 0x00, // TXPOWER_100uW = -23dBm == PAC=0 TBG=0 - A7105_POWER_1 = 0x00<<3 | 0x01, // TXPOWER_300uW = -20dBm == PAC=0 TBG=1 - A7105_POWER_2 = 0x00<<3 | 0x02, // TXPOWER_1mW = -16dBm == PAC=0 TBG=2 - A7105_POWER_3 = 0x00<<3 | 0x04, // TXPOWER_3mW = -11dBm == PAC=0 TBG=4 - A7105_POWER_4 = 0x01<<3 | 0x05, // TXPOWER_10mW = -6dBm == PAC=1 TBG=5 - A7105_POWER_5 = 0x02<<3 | 0x07, // TXPOWER_30mW = 0dBm == PAC=2 TBG=7 - A7105_POWER_6 = 0x03<<3 | 0x07, // TXPOWER_100mW = 1dBm == PAC=3 TBG=7 - A7105_POWER_7 = 0x03<<3 | 0x07 // TXPOWER_150mW = 1dBm == PAC=3 TBG=7 + A7105_POWER_0 = 0x00<<3 | 0x00, // -23dBm == PAC=0 TBG=0 + A7105_POWER_1 = 0x00<<3 | 0x01, // -20dBm == PAC=0 TBG=1 + A7105_POWER_2 = 0x00<<3 | 0x02, // -16dBm == PAC=0 TBG=2 + A7105_POWER_3 = 0x00<<3 | 0x04, // -11dBm == PAC=0 TBG=4 + A7105_POWER_4 = 0x01<<3 | 0x05, // -6dBm == PAC=1 TBG=5 + A7105_POWER_5 = 0x02<<3 | 0x07, // 0dBm == PAC=2 TBG=7 + A7105_POWER_6 = 0x03<<3 | 0x07, // +1dBm == PAC=3 TBG=7 + A7105_POWER_7 = 0x03<<3 | 0x07 // +1dBm == PAC=3 TBG=7 }; #define A7105_HIGH_POWER A7105_POWER_7 #define A7105_LOW_POWER A7105_POWER_3 @@ -621,14 +621,13 @@ enum A7105_POWER #define A7105_BIND_POWER A7105_POWER_0 // NRF Power -// Power setting is 0..3 for nRF24L01 -// Claimed power amp for nRF24L01 from eBay is 20dBm. +// The numbers do not take into account any outside amplifier enum NRF_POWER -{ // Raw w 20dBm PA - NRF_POWER_0 = 0x00, // 0 : -18dBm (16uW) 2dBm (1.6mW) - NRF_POWER_1 = 0x01, // 1 : -12dBm (60uW) 8dBm (6mW) - NRF_POWER_2 = 0x02, // 2 : -6dBm (250uW) 14dBm (25mW) - NRF_POWER_3 = 0x03 // 3 : 0dBm (1mW) 20dBm (100mW) +{ + NRF_POWER_0 = 0x00, // -18dBm + NRF_POWER_1 = 0x01, // -12dBm + NRF_POWER_2 = 0x02, // -6dBm + NRF_POWER_3 = 0x03 // 0dBm }; #define NRF_HIGH_POWER NRF_POWER_3 #define NRF_LOW_POWER NRF_POWER_1 @@ -665,6 +664,7 @@ enum CC2500_POWER #define CC2500_BIND_POWER CC2500_POWER_1 // CYRF power +// The numbers do not take into account any outside amplifier enum CYRF_POWER { CYRF_POWER_0 = 0x00, // -35dbm From 48b90029c46d821208b619d303d5fe970a9af189 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 14 Aug 2020 19:39:24 +0200 Subject: [PATCH 22/24] V761: Work with any ID. Tested on Eachine RX. --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/V761_nrf24l01.ino | 60 +++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 43945c5..cfeb9b2 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 54 +#define VERSION_PATCH_LEVEL 55 //****************** // Protocols diff --git a/Multiprotocol/V761_nrf24l01.ino b/Multiprotocol/V761_nrf24l01.ino index 3f908b9..6692caa 100644 --- a/Multiprotocol/V761_nrf24l01.ino +++ b/Multiprotocol/V761_nrf24l01.ino @@ -17,12 +17,12 @@ Multiprotocol is distributed in the hope that it will be useful, #include "iface_nrf24l01.h" +//#define V761_FORCE_ID + #define V761_PACKET_PERIOD 7060 // Timeout for callback in uSec #define V761_INITIAL_WAIT 500 #define V761_PACKET_SIZE 8 #define V761_BIND_COUNT 200 - -//Fx chan management #define V761_BIND_FREQ 0x28 #define V761_RF_NUM_CHANNELS 3 @@ -143,31 +143,39 @@ static void __attribute__((unused)) V761_init() static void __attribute__((unused)) V761_initialize_txid() { - switch(RX_num%5) - { - case 1: //Dump from air on Protonus TX - memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4); - memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2); - break; - case 2: //Dump from air on mshagg2 TX - memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4); - memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2); - break; - case 3: //Dump from air on MikeHRC Eachine TX - memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4); // To be checked - memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2); // To be checked - break; - case 4: //Dump from air on Crashanium Eachine TX - memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4); // To be checked - memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",3); // To be checked - break; - default: //Dump from SPI - memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4); - memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",3); - break; - } - //rx_tx_addr[0]+=RX_num; + #ifdef V761_FORCE_ID + switch(RX_num%5) + { + case 1: //Dump from air on Protonus TX + memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4); + memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2); + break; + case 2: //Dump from air on mshagg2 TX + memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4); + memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2); + break; + case 3: //Dump from air on MikeHRC Eachine TX + memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4); + memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2); + break; + case 4: //Dump from air on Crashanium Eachine TX + memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4); + memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",2); + break; + default: //Dump from SPI + memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4); + memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",2); + break; + } + #else + //Tested with Eachine RX + rx_tx_addr[0]+=RX_num; + hopping_frequency[0]=(rx_tx_addr[0]&0x0F)+0x05; + hopping_frequency[1]=hopping_frequency[0]+0x05+(RX_num%0x2D); + #endif + hopping_frequency[2]=hopping_frequency[0]+0x37; + debugln("ID: %02X %02X %02X %02X , HOP: %02X %02X %02X",rx_tx_addr[0],rx_tx_addr[1],rx_tx_addr[2],rx_tx_addr[3],hopping_frequency[0],hopping_frequency[1],hopping_frequency[2]); } From 4e0fccfc631a5df6b45f6a04e0d22cfb553a818b Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Fri, 14 Aug 2020 19:40:25 +0200 Subject: [PATCH 23/24] Update Protocols_Details.md --- Protocols_Details.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index ac88d3f..1a7b176 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1524,8 +1524,6 @@ A|E|T|R|FLIP|LIGHT ## V761 - *48* -Warning: **Only 5 IDs**, you can cycle through them using RX_Num. - Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off Calib: momentary switch, calib will happen one the channel goes from -100% to +100% Flip: momentary switch: hold flip(+100%), indicate flip direction with Ele or Ail, release flip(-100%) From b1e4daf1c2e7a86f1ce74921c67167f55abb5409 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Sat, 15 Aug 2020 16:17:18 +0200 Subject: [PATCH 24/24] OMP: new protocol intial release Untested!!! --- Multiprotocol/Multi.txt | 3 +- Multiprotocol/Multi_Names.ino | 4 + Multiprotocol/Multiprotocol.h | 4 +- Multiprotocol/Multiprotocol.ino | 6 ++ Multiprotocol/OMP_nrf24l01.ino | 135 ++++++++++++++++++++++++++++++++ Multiprotocol/Validate.h | 1 + Multiprotocol/_Config.h | 3 + Protocols_Details.md | 18 ++++- 8 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 Multiprotocol/OMP_nrf24l01.ino diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index 4afa60c..0e4020e 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -72,4 +72,5 @@ 72,Q90C 73,Kyosho 74,RadioLink,Surface -76,Realacc,R11 \ No newline at end of file +76,Realacc,R11 +77,OMP \ No newline at end of file diff --git a/Multiprotocol/Multi_Names.ino b/Multiprotocol/Multi_Names.ino index 99b2714..c339f44 100644 --- a/Multiprotocol/Multi_Names.ino +++ b/Multiprotocol/Multi_Names.ino @@ -89,6 +89,7 @@ const char STR_SKYARTEC[] ="Skyartc"; const char STR_KYOSHO[] ="Kyosho"; const char STR_RLINK[] ="RadLink"; const char STR_REALACC[] ="Realacc"; +const char STR_OMP[] ="OMP"; const char STR_TEST[] ="Test"; const char STR_FAKE[] ="Fake"; @@ -307,6 +308,9 @@ const mm_protocol_definition multi_protocols[] = { #if defined(NCC1701_NRF24L01_INO) {PROTO_NCC1701, STR_NCC1701, 0, NO_SUBTYPE, OPTION_NONE }, #endif + #if defined(OMP_NRF24L01_INO) + {PROTO_OMP, STR_OMP, 0, NO_SUBTYPE, OPTION_RFTUNE }, + #endif #if defined(PELIKAN_A7105_INO) {PROTO_PELIKAN, STR_PELIKAN , 2, STR_SUBTYPE_PELIKAN, OPTION_NONE }, #endif diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index cfeb9b2..295973e 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 55 +#define VERSION_PATCH_LEVEL 56 //****************** // Protocols @@ -102,6 +102,7 @@ enum PROTOCOLS PROTO_KYOSHO = 73, // =>A7105 PROTO_RLINK = 74, // =>CC2500 PROTO_REALACC = 76, // =>NRF24L01 + PROTO_OMP = 77, // =>NRF24L01 PROTO_FAKE = 126, // =>CC2500+NRF24L01 PROTO_TEST = 127, // =>CC2500 @@ -811,6 +812,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- KYOSHO 73 RLINK 74 REALACC 76 + OMP 77 BindBit=> 0x80 1=Bind/0=No AutoBindBit=> 0x40 1=Yes /0=No RangeCheck=> 0x20 1=Yes /0=No diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index b255c86..abd3214 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1604,6 +1604,12 @@ static void protocol_init() remote_callback = REALACC_callback; break; #endif + #if defined(OMP_NRF24L01_INO) + case PROTO_OMP: + next_callback=initOMP(); + remote_callback = OMP_callback; + break; + #endif #if defined(TEST_CC2500_INO) case PROTO_TEST: next_callback=initTEST(); diff --git a/Multiprotocol/OMP_nrf24l01.ino b/Multiprotocol/OMP_nrf24l01.ino new file mode 100644 index 0000000..7ea7e10 --- /dev/null +++ b/Multiprotocol/OMP_nrf24l01.ino @@ -0,0 +1,135 @@ +/* + This project is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +Multiprotocol is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Multiprotocol. If not, see . + */ + +#if defined(OMP_NRF24L01_INO) + +#include "iface_nrf250k.h" + +#define FORCE_OMP_ORIGINAL_ID + +#define OMP_INITIAL_WAIT 500 +#define OMP_PACKET_PERIOD 5000 +#define OMP_RF_BIND_CHANNEL 35 +#define OMP_RF_NUM_CHANNELS 8 +#define OMP_PAYLOAD_SIZE 16 +#define OMP_BIND_COUNT 600 //3sec + +static void __attribute__((unused)) OMP_send_packet() +{ + if(IS_BIND_IN_PROGRESS) + { + memcpy(packet,"BND",3); + memcpy(&packet[3],rx_tx_addr,5); + memcpy(&packet[8],hopping_frequency,8); + } + else + { + memset(packet,0x00,OMP_PAYLOAD_SIZE); + + //hopping frequency + packet[0 ] = hopping_frequency_no; // |0x40 to request RX telemetry + XN297L_Hopping(hopping_frequency_no); + hopping_frequency_no++; + hopping_frequency_no &= OMP_RF_NUM_CHANNELS-1; // 8 RF channels + + //flags + packet[1 ] = 0x08 //unknown + | GET_FLAG(CH5_SW, 0x20); // HOLD + + packet[2 ] = 0x40; //unknown + + if(Channel_data[CH6] > CHANNEL_MAX_COMMAND) + packet[2 ] |= 0x20; // IDLE2 + else if(Channel_data[CH6] > CHANNEL_MIN_COMMAND) + packet[1 ] |= 0x40; // IDLE1 + + if(Channel_data[CH7] > CHANNEL_MAX_COMMAND) + packet[2 ] |= 0x08; // 3D + else if(Channel_data[CH7] > CHANNEL_MIN_COMMAND) + packet[2 ] |= 0x04; // ATTITUDE + + //trims?? + //packet[3..6] + + //channels TAER packed 11bits + uint16_t channel=convert_channel_16b_limit(THROTTLE,0,2047); + packet[7 ] = channel; + packet[8 ] = channel>>8; + channel=convert_channel_16b_limit(AILERON,0,2047); + packet[8 ] |= channel<<3; + packet[9 ] = channel>>5; + channel=convert_channel_16b_limit(ELEVATOR,0,2047); + packet[10] |= channel<<6; + packet[11] = channel>>2; + packet[12] = channel>>10; + channel=convert_channel_16b_limit(RUDDER,0,2047); + packet[12] |= channel<<1; + packet[13] = channel>>8; + + //unknown + //packet[13] = 0x00; + //packet[14] = 0x00; + packet[15] = 0x04; + } + + XN297L_SetPower(); // Set tx_power + XN297L_SetFreqOffset(); // Set frequency offset + XN297L_WriteEnhancedPayload(packet, OMP_PAYLOAD_SIZE, IS_BIND_IN_PROGRESS); +} + +static void __attribute__((unused)) OMP_init() +{ + XN297L_Init(); + XN297L_SetTXAddr((uint8_t*)"FLPBD", 5); + XN297L_HoppingCalib(OMP_RF_NUM_CHANNELS); // Calibrate all channels + XN297L_RFChannel(OMP_RF_BIND_CHANNEL); // Set bind channel +} + +static void __attribute__((unused)) OMP_initialize_txid() +{ + calc_fh_channels(OMP_RF_NUM_CHANNELS); + #ifdef FORCE_OMP_ORIGINAL_ID + rx_tx_addr[0]=0x4E; + rx_tx_addr[1]=0x72; + rx_tx_addr[2]=0x8E; + rx_tx_addr[3]=0x70; + rx_tx_addr[4]=0x62; + for(uint8_t i=0; i