From 8e663f2531bf410beb0d5032a32448a34dc18534 Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:07:34 -0800 Subject: [PATCH 01/19] Update V911S_ccnrf.ino to add 6G/Senior and light for XK A280 (#929) --- Multiprotocol/V911S_ccnrf.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/V911S_ccnrf.ino b/Multiprotocol/V911S_ccnrf.ino index 665d67a86..2900a33bc 100644 --- a/Multiprotocol/V911S_ccnrf.ino +++ b/Multiprotocol/V911S_ccnrf.ino @@ -35,6 +35,8 @@ // flags going to packet[2] #define V911S_FLAG_CALIB 0x01 #define A220_FLAG_6G3D 0x04 +#define A280_FLAG_6GSENIOR 0x08 +#define A280_FLAG_LIGHT 0x20 static void __attribute__((unused)) V911S_send_packet() { @@ -74,7 +76,9 @@ static void __attribute__((unused)) V911S_send_packet() { packet[ 1]=GET_FLAG(!CH6_SW,E119_FLAG_EXPERT) // short press on left button |GET_FLAG( CH5_SW,E119_FLAG_CALIB); // short press on right button - packet[ 2]=GET_FLAG( CH7_SW,A220_FLAG_6G3D); // short press on right button + packet[ 2]=GET_FLAG( CH7_SW,A220_FLAG_6G3D) // short press on right button + |GET_FLAG( CH8_SW,A280_FLAG_6GSENIOR) // -100% - 6G, +100% - Senior mode (turn off gyro) + |GET_FLAG( CH9_SW,A280_FLAG_LIGHT); // cycle the light through on-flash-off when the CH9 value is changed from -100% to 100% } //packet[3..6]=trims TAER signed From 457703b881d6d2d1be7551b6552d3b846e0d18ae Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 18 Jan 2024 12:16:59 +0100 Subject: [PATCH 02/19] Update Protocols_Details.md --- Protocols_Details.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index 511c4d6ce..5976c2965 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1390,9 +1390,11 @@ Models: WLtoys V911S, XK A110 ### Sub_protocol E119 - *1* Models: Eachine E119, JJRC W01-J3, XK A220 P-40, XK A800 R2, F959S R2, A160 R2, A280 -CH1|CH2|CH3|CH4|CH5|CH6|CH7 ----|---|---|---|---|---|--- -A|E|T|R|CALIB|RATE|6G_3D +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9 +---|---|---|---|---|---|---|---|--- +A|E|T|R|CALIB|RATE|6G_3D|6GSENIOR|LIGHT + +A280 -> 6GSENIOR: -100% - 6G, +100% - Senior mode (turn off gyro), LIGHT: cycle the light through on-flash-off when the CH9 value is changed from -100% to 100% ## XK - *62* From a7d6d12679c8192acf058017123135076c81d253 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 29 Jan 2024 17:00:54 +0100 Subject: [PATCH 03/19] Kyosho Syncro Sub protocol Syncro for KT-331 and KR-331 --- Lua_scripts/MultiChan.txt | 4 +++- Multiprotocol/A7105_SPI.ino | 4 ++-- Multiprotocol/Kyosho_a7105.ino | 32 ++++++++++++++++++++++++-------- Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Protos.ino | 4 ++-- Multiprotocol/Multiprotocol.h | 11 ++++++----- Multiprotocol/_Config.h | 1 + Protocols_Details.md | 11 ++++++++++- 8 files changed, 49 insertions(+), 20 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 7a0846acc..b761af7af 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -121,7 +121,9 @@ 49,2,KF606,ZCZ50,1,Trim,UNK 9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim 9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 +73,0,Kyosho,FHSS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 +73,1,Kyosho,Hype,0,CH5,CH6 +73,2,Kyosho,Syncro,0,CH5,CH6 18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate 18,1,MJXQ,X600,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate 18,2,MJXQ,X800,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate diff --git a/Multiprotocol/A7105_SPI.ino b/Multiprotocol/A7105_SPI.ino index ac8f2bc44..5a5927fcb 100644 --- a/Multiprotocol/A7105_SPI.ino +++ b/Multiprotocol/A7105_SPI.ino @@ -418,7 +418,7 @@ void A7105_Init(void) #ifdef KYOSHO_A7105_INO if(protocol==PROTO_KYOSHO) { - if(sub_protocol==KYOSHO_FHSS) + if(sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO) A7105_Regs=(uint8_t*)KYOSHO_A7105_regs; else A7105_Regs=(uint8_t*)KYOSHO_HYPE_A7105_regs; @@ -446,7 +446,7 @@ void A7105_Init(void) } A7105_Strobe(A7105_STANDBY); - if(protocol==PROTO_KYOSHO && sub_protocol==KYOSHO_FHSS) + if(protocol==PROTO_KYOSHO && (sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO)) {//strange calibration... //IF Filter Bank Calibration A7105_WriteReg(A7105_02_CALC,0x0F); diff --git a/Multiprotocol/Kyosho_a7105.ino b/Multiprotocol/Kyosho_a7105.ino index 18c24c774..2618d0957 100644 --- a/Multiprotocol/Kyosho_a7105.ino +++ b/Multiprotocol/Kyosho_a7105.ino @@ -19,6 +19,7 @@ //#define KYOSHO_FORCE_ID_FHSS //#define KYOSHO_FORCE_ID_HYPE +//#define KYOSHO_FORCE_ID_SYNCRO //Kyosho constants & variables #define KYOSHO_BIND_COUNT 2500 @@ -32,6 +33,11 @@ static void __attribute__((unused)) KYOSHO_send_packet() packet[4] = rx_tx_addr[3]; //unknown may be RX ID on some other remotes memset(packet+5,0xFF,4); + + //unknwon but for Syncro the same values are used for bind and normal + packet[27] = sub_protocol==KYOSHO_FHSS?0x05:0x07; // Syncro is 7 + packet[28] = 0x00; + memset(packet+29,0xFF,8); if(IS_BIND_IN_PROGRESS) { @@ -42,10 +48,6 @@ static void __attribute__((unused)) KYOSHO_send_packet() //RF table for(uint8_t i=0; i<16;i++) packet[i+11]=hopping_frequency[i+(packet[9]<<4)]; - //unknwon - packet[27] = 0x05; - packet[28] = 0x00; - memset(packet+29,0xFF,8); //frequency hop during bind if(packet[9]) rf_ch_num=0x8C; @@ -55,13 +57,20 @@ static void __attribute__((unused)) KYOSHO_send_packet() else { packet[ 0] = 0x58; // normal packet - //14 channels: steering, throttle, ... - for(uint8_t i = 0; i < 14; i++) + //FHSS 14 channels: steering, throttle, ... + //Syncro 6 channels: steering, throttle, ... + for(uint8_t i = 0; i < sub_protocol==KYOSHO_FHSS?14:6; i++) { uint16_t temp=convert_channel_ppm(i); packet[9 + i*2]=temp&0xFF; // low byte of servo timing(1000-2000us) packet[10 + i*2]=(temp>>8)&0xFF; // high byte of servo timing(1000-2000us) } + if(sub_protocol==KYOSHO_SYNCRO) + { + memcpy(&packet[21],&hopping_frequency[11],6); + packet[34] = 0x0F; + packet[36] = 0x0F; + } rf_ch_num=hopping_frequency[hopping_frequency_no]; hopping_frequency_no++; packet[34] |= (hopping_frequency_no&0x0F)<<4; @@ -150,7 +159,7 @@ uint16_t KYOSHO_callback() telemetry_set_input_sync(packet_period); #endif } - if(sub_protocol==KYOSHO_FHSS) + if(sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO) KYOSHO_send_packet(); else//HYPE KYOSHO_hype_send_packet(); @@ -162,7 +171,7 @@ void KYOSHO_init() A7105_Init(); // compute channels from ID - calc_fh_channels(sub_protocol==KYOSHO_FHSS?32:15); + calc_fh_channels(sub_protocol==KYOSHO_HYPE?15:32); hopping_frequency_no=0; #ifdef KYOSHO_FORCE_ID_FHSS @@ -172,6 +181,13 @@ void KYOSHO_init() memcpy(hopping_frequency,"\x29\x4C\x67\x92\x31\x1C\x77\x18\x23\x6E\x81\x5C\x8F\x5A\x51\x94\x7A\x12\x45\x6C\x7F\x1E\x0D\x88\x63\x8C\x4F\x37\x26\x61\x2C\x8A",32); } #endif + #ifdef KYOSHO_FORCE_ID_SYNCRO + if(sub_protocol==KYOSHO_SYNCRO) + { + memcpy(rx_tx_addr,"\x00\xC2\x24\x00",4); + memcpy(hopping_frequency,"\x73\x12\x7D\x88\x63\x4A\x8D\x60\x57\x16\x5D\x8B\x25\x53\x6E\x3C\x41\x70\x20\x83\x2A\x19\x94\x2F\x91\x4C\x47\x36\x78\x10\x5A\x31",32); + } + #endif if(sub_protocol==KYOSHO_HYPE) { MProtocol_id &= 0x00FF00FF; diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index f420d6a74..8f1cfcb4e 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -70,7 +70,7 @@ 70,DSM_RX,Multi,CloneTX,EraseTX,CPPM 71,JJRC345,JJRC345,SkyTmblr 72,Q90C -73,Kyosho,FHSS,Hype +73,Kyosho,FHSS,Hype,Syncro 74,RadioLink,Surface,Air,DumboRC 75,--- 76,Realacc,R11 diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index 32bd83efa..603046186 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -169,7 +169,7 @@ const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24"; const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC"; const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC"; const char STR_SUBTYPE_REALACC[] = "\x03""R11"; -const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype"; +const char STR_SUBTYPE_KYOSHO[] = "\x06""FHSS""Hype""Sync"; const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17"; const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS"; const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr"; @@ -379,7 +379,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_KN, STR_KN, STR_SUBTYPE_KN, 2, OPTION_NONE, 0, 0, SW_NRF, KN_init, KN_callback }, #endif #if defined(KYOSHO_A7105_INO) - {PROTO_KYOSHO, STR_KYOSHO, STR_SUBTYPE_KYOSHO, 2, OPTION_NONE, 0, 1, SW_A7105, KYOSHO_init, KYOSHO_callback }, + {PROTO_KYOSHO, STR_KYOSHO, STR_SUBTYPE_KYOSHO, 3, OPTION_NONE, 0, 1, SW_A7105, KYOSHO_init, KYOSHO_callback }, #endif #if defined(KYOSHO2_NRF24L01_INO) {PROTO_KYOSHO2, STR_KYOSHO2, STR_SUBTYPE_KYOSHO2, 1, OPTION_NONE, 0, 0, SW_NRF, KYOSHO2_init, KYOSHO2_callback }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index abfb044a0..ca506d8ed 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 43 +#define VERSION_PATCH_LEVEL 44 #define MODE_SERIAL 0 @@ -437,8 +437,9 @@ enum HEIGHT }; enum KYOSHO { - KYOSHO_FHSS = 0, - KYOSHO_HYPE = 1, + KYOSHO_FHSS = 0, + KYOSHO_HYPE = 1, + KYOSHO_SYNCRO = 2, }; enum JJRC345 { @@ -833,8 +834,8 @@ enum { #define DSM_RX_EEPROM_OFFSET 877 // (4) TX ID + format, 5 bytes, end is 882 #define MOULDKG_EEPROM_OFFSET 882 // RX ID, 3 bytes per model, end is 882+64*3=1074 #define DSM_CLONE_EEPROM_OFFSET 1074 // (4) TX ID, (1) Initialized, end is 1079 -#define TRAXXAS_EEPROM_OFFSET 1079 // RX ID, 2 bytes per model id, end is 1079+128=1207 -//#define CONFIG_EEPROM_OFFSET 1207 // Current configuration of the multimodule +#define TRAXXAS_EEPROM_OFFSET 1079 // RX ID and SOP index, 3 bytes per model id, end is 1079+192=1271 +//#define CONFIG_EEPROM_OFFSET 1271 // Current configuration of the multimodule /* STM32 Flash Size */ #ifndef DISABLE_FLASH_SIZE_CHECK diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index e70c12dac..32fc041cb 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -734,6 +734,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PROTO_KYOSHO KYOSHO_FHSS KYOSHO_HYPE + KYOSHO_SYNCRO PROTO_KYOSHO2 NONE PROTO_LOLI diff --git a/Protocols_Details.md b/Protocols_Details.md index 5976c2965..94a7b0314 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -113,7 +113,7 @@ CFlie|38|CFlie||||||||NRF24L01| [JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297 [KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297 [KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01| -[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105| +[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|Syncro||||||A7105| [Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01| [LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01| [Losi](Protocols_Details.md#Losi---89)|89|||||||||CYRF6936| @@ -343,6 +343,15 @@ A|E|T|R|CH5|CH6 RX output will match the Hype standard AETR independently of the input configuration AETR, RETA... unless on OpenTX 2.3.3+ you use the "Disable channel mapping" feature on the GUI. +### Sub_protocol Syncro - *2* +Surface protocol called Syncro. TX: KT-331, RX: KR-331 + +Extended limits supported + +CH1|CH2|CH3|CH4|CH5|CH6 +---|---|---|---|---|--- +STEERING|THROTTLE|CH3|CH4|CH5|CH6 + ## Pelikan - *60* Extended limits supported From 3d989a47dbedecc871fcda432aecd723148ceb42 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 29 Jan 2024 18:45:32 +0100 Subject: [PATCH 04/19] Typo... --- Multiprotocol/Multi_Protos.ino | 2 +- Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index 603046186..4aac1679b 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -169,7 +169,7 @@ const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24"; const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC"; const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC"; const char STR_SUBTYPE_REALACC[] = "\x03""R11"; -const char STR_SUBTYPE_KYOSHO[] = "\x06""FHSS""Hype""Sync"; +const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype""Sync"; const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17"; const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS"; const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr"; diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index ca506d8ed..64ef8eefa 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 44 +#define VERSION_PATCH_LEVEL 45 #define MODE_SERIAL 0 From 2888d3e93747c66d613dc173169d43e5d0181e54 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 29 Jan 2024 18:59:24 +0100 Subject: [PATCH 05/19] TRAXXAS TQ WIP It still won't work unless you have some luck. I still need to work on the RF frequency. --- Multiprotocol/CYRF6936_SPI.ino | 12 +++++- Multiprotocol/TRAXXAS_cyrf6936.ino | 65 +++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/Multiprotocol/CYRF6936_SPI.ino b/Multiprotocol/CYRF6936_SPI.ino index abef60870..83db4e9bf 100644 --- a/Multiprotocol/CYRF6936_SPI.ino +++ b/Multiprotocol/CYRF6936_SPI.ino @@ -298,7 +298,7 @@ void CYRF_FindBestChannels(uint8_t *channels, uint8_t len, uint8_t minspace, uin CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Clear abort RX } -#if defined(DEVO_CYRF6936_INO) || defined(J6PRO_CYRF6936_INO) +#if defined(DEVO_CYRF6936_INO) || defined(J6PRO_CYRF6936_INO) || defined(TRAXXAS_CYRF6936_INO) const uint8_t PROGMEM DEVO_j6pro_sopcodes[][8] = { /* Note these are in order transmitted (LSB 1st) */ {0x3C, 0x37, 0xCC, 0x91, 0xE2, 0xF8, 0xCC, 0x91}, @@ -311,7 +311,7 @@ const uint8_t PROGMEM DEVO_j6pro_sopcodes[][8] = { {0xB9, 0x8E, 0x19, 0x74, 0x6F, 0x65, 0x18, 0x74}, {0xDF, 0xB1, 0xC0, 0x49, 0x62, 0xDF, 0xC1, 0x49}, {0x97, 0xE5, 0x14, 0x72, 0x7F, 0x1A, 0x14, 0x72}, -#if defined(J6PRO_CYRF6936_INO) +#if defined(J6PRO_CYRF6936_INO) || defined(TRAXXAS_CYRF6936_INO) {0x82, 0xC7, 0x90, 0x36, 0x21, 0x03, 0xFF, 0x17}, {0xE2, 0xF8, 0xCC, 0x91, 0x3C, 0x37, 0xCC, 0x91}, //Note: the '03' was '9E' in the Cypress recommended table {0xAD, 0x39, 0xA2, 0x0F, 0x9B, 0xC5, 0xA1, 0x0F}, //The following are the same as the 1st 8 above, @@ -322,14 +322,22 @@ const uint8_t PROGMEM DEVO_j6pro_sopcodes[][8] = { {0x9E, 0x82, 0xDC, 0x3C, 0xA1, 0x78, 0xDC, 0x3C}, {0x6F, 0x65, 0x18, 0x74, 0xB9, 0x8E, 0x19, 0x74}, #endif +#if defined(TRAXXAS_CYRF6936_INO) + {0x62, 0xDF, 0xC1, 0x49, 0xDF, 0xB1, 0xC0, 0x49}, +#endif }; #endif static void __attribute__((unused)) CYRF_PROGMEM_ConfigSOPCode(const uint8_t *data) { uint8_t code[8]; + //debug("SOP:"); for(uint8_t i=0;i<8;i++) + { code[i]=pgm_read_byte_near(&data[i]); + //debug(" %02X",code[i]); + } + //debugln(""); CYRF_ConfigSOPCode(code); } diff --git a/Multiprotocol/TRAXXAS_cyrf6936.ino b/Multiprotocol/TRAXXAS_cyrf6936.ino index bdd32aa69..20cdce0f7 100644 --- a/Multiprotocol/TRAXXAS_cyrf6936.ino +++ b/Multiprotocol/TRAXXAS_cyrf6936.ino @@ -20,11 +20,12 @@ #include "iface_cyrf6936.h" //#define TRAXXAS_FORCE_ID -//#define TRAXXAS_DEBUG +#define TRAXXAS_DEBUG -#define TRAXXAS_CHANNEL 0x05 -#define TRAXXAS_BIND_CHANNEL 0x2B -#define TRAXXAS_PACKET_SIZE 16 +#define TRAXXAS_CHANNEL 0x0F +#define TRAXXAS_BIND_CHANNEL 0x2B +#define TRAXXAS_BIND_CHECK 0x22 +#define TRAXXAS_PACKET_SIZE 16 enum { TRAXXAS_BIND_PREP_RX=0, @@ -34,10 +35,6 @@ enum { TRAXXAS_DATA, }; -const uint8_t PROGMEM TRAXXAS_sop_bind[] ={ 0x3C, 0x37, 0xCC, 0x91, 0xE2, 0xF8, 0xCC, 0x91 }; -const uint8_t PROGMEM TRAXXAS_sop_data[] ={ 0xA1, 0x78, 0xDC, 0x3C, 0x9E, 0x82, 0xDC, 0x3C }; -//const uint8_t PROGMEM TRAXXAS_sop_check[]={ 0x97, 0xE5, 0x14, 0x72, 0x7F, 0x1A, 0x14, 0x72 }; - const uint8_t PROGMEM TRAXXAS_init_vals[][2] = { //Init from dump {CYRF_0B_PWR_CTRL, 0x00}, // PMU @@ -53,7 +50,7 @@ const uint8_t PROGMEM TRAXXAS_init_vals[][2] = { static void __attribute__((unused)) TRAXXAS_cyrf_bind_config() { - CYRF_PROGMEM_ConfigSOPCode(TRAXXAS_sop_bind); + CYRF_PROGMEM_ConfigSOPCode(DEVO_j6pro_sopcodes[0]); CYRF_WriteRegister(CYRF_15_CRC_SEED_LSB, 0x5A); CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, 0x5A); CYRF_ConfigRFChannel(TRAXXAS_BIND_CHANNEL); @@ -61,14 +58,15 @@ static void __attribute__((unused)) TRAXXAS_cyrf_bind_config() static void __attribute__((unused)) TRAXXAS_cyrf_data_config() { - CYRF_PROGMEM_ConfigSOPCode(TRAXXAS_sop_data); #ifdef TRAXXAS_FORCE_ID // data taken from TX dump CYRF_WriteRegister(CYRF_15_CRC_SEED_LSB, 0x1B); CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, 0x3F); + CYRF_PROGMEM_ConfigSOPCode(DEVO_j6pro_sopcodes[6]); #else - uint16_t addr=TRAXXAS_EEPROM_OFFSET+RX_num*2; + uint16_t addr=TRAXXAS_EEPROM_OFFSET+RX_num*3; CYRF_WriteRegister(CYRF_15_CRC_SEED_LSB, cyrfmfg_id[0] - eeprom_read_byte((EE_ADDR)(addr + 0))); CYRF_WriteRegister(CYRF_16_CRC_SEED_MSB, cyrfmfg_id[1] - eeprom_read_byte((EE_ADDR)(addr + 1))); + CYRF_PROGMEM_ConfigSOPCode(DEVO_j6pro_sopcodes[eeprom_read_byte((EE_ADDR)(addr + 2)) % 20]); #endif CYRF_ConfigRFChannel(TRAXXAS_CHANNEL); CYRF_SetTxRxMode(TX_EN); @@ -108,6 +106,7 @@ uint16_t TRAXXAS_callback() switch(phase) { case TRAXXAS_BIND_PREP_RX: + //debugln("BIND_PREP_RX"); TRAXXAS_cyrf_bind_config(); CYRF_SetTxRxMode(RX_EN); //Receive mode CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x83); //Prepare to receive @@ -115,6 +114,7 @@ uint16_t TRAXXAS_callback() phase=TRAXXAS_BIND_RX; return 700; case TRAXXAS_BIND_RX: + //debugln("BIND_RX"); //Read data from RX status = CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS); if((status & 0x03) == 0x02) // RXC=1, RXE=0 then 2nd check is required (debouncing) @@ -139,15 +139,18 @@ uint16_t TRAXXAS_callback() debugln(""); #endif // Store RX ID - uint16_t addr=TRAXXAS_EEPROM_OFFSET+RX_num*2; + uint16_t addr=TRAXXAS_EEPROM_OFFSET+RX_num*3; for(uint8_t i=0;i<2;i++) eeprom_write_byte((EE_ADDR)(addr+i),packet[i+1]); + //Store SOP index + eeprom_write_byte((EE_ADDR)(addr+2),packet[7]); // Replace RX ID by TX ID for(uint8_t i=0;i<6;i++) packet[i+1]=cyrfmfg_id[i]; - packet[7 ] = 0xEE; // Not needed ?? + //packet[7 ] = 0xEE; // Not needed ?? + packet[8] = TRAXXAS_CHANNEL - 1; packet[10] = 0x01; // Must change otherwise bind doesn't complete - packet[13] = 0x05; // Not needed ?? + //packet[13] = 0x05; // Not needed ?? packet_count=12; CYRF_SetTxRxMode(TX_EN); phase=TRAXXAS_BIND_TX1; @@ -166,6 +169,7 @@ uint16_t TRAXXAS_callback() } return 700; case TRAXXAS_BIND_TX1: + //debugln("BIND_TX1"); CYRF_WriteDataPacketLen(packet, TRAXXAS_PACKET_SIZE); #ifdef TRAXXAS_DEBUG debug("P="); @@ -177,10 +181,12 @@ uint16_t TRAXXAS_callback() phase=TRAXXAS_PREP_DATA; break; case TRAXXAS_PREP_DATA: + //debugln("PREP_DATA"); BIND_DONE; TRAXXAS_cyrf_data_config(); phase++; case TRAXXAS_DATA: + //debugln("DATA"); #ifdef MULTI_SYNC telemetry_set_input_sync(13940); #endif @@ -222,7 +228,7 @@ void TRAXXAS_init() // TRAXXAS_cyrf_bind_config(); // CYRF_SetTxRxMode(TX_EN); // memcpy(packet,(uint8_t *)"\x02\x4A\xA3\x2D\x1A\x49\xFE\x06\x00\x00\x02\x01\x06\x06\x00\x00",TRAXXAS_PACKET_SIZE); -// memcpy(packet,(uint8_t *)"\x02\xFF\xFF\xFF\xFF\xFF\xFF\x01\x01\x01\x02\x01\x06\x00\x00\x00",TRAXXAS_PACKET_SIZE); +// memcpy(packet,(uint8_t *)"\x02\x49\xAC\x4F\x55\x4D\xFE\x05\x00\x00\x02\x01\x06\x06\x00\x00",TRAXXAS_PACKET_SIZE); } /* @@ -274,4 +280,33 @@ RX ID: \x00\x00\x2D\x1A\x49\xFE CRC 0x65 0xE2 => CRC: 65-00=65 E2-00=E2 RX ID: \x00\xFF\x2D\x1A\x49\xFE CRC 0x65 0xE3 => CRC: 65-00=65 E2-FF=E3 RX ID: \xFF\x00\x2D\x1A\x49\xFE CRC 0x66 0xE2 => CRC: 65-FF=66 E2-00=E2 */ +/* +RX1: 02 4A A3 2D 1A 49 FE 06 00 00 02 01 06 06 00 00 +SOP: A1 78 DC 3C 9E 82 DC 3C +RX2: 02 49 AC 4F 55 4D FE 05 00 00 02 01 06 06 00 00 +SOP: 5A CC AE 46 B6 31 AE 46 +RX3: 02 CA F3 62 55 4D FE 03 00 00 02 01 06 06 00 00 +SOP: 66 CD 7C 50 DD 26 7C 50 + +Dump of SOP Codes: +00: 3C 37 CC 91 E2 F8 CC 91 => bind +01: 9B C5 A1 0F AD 39 A2 0F +02: EF 64 B0 2A D2 8F B1 2A +03: 66 CD 7C 50 DD 26 7C 50 +04: 5C E1 F6 44 AD 16 F6 44 +05: 5A CC AE 46 B6 31 AE 46 +06: A1 78 DC 3C 9E 82 DC 3C +07: B9 8E 19 74 6F 65 18 74 +08: DF B1 C0 49 62 DF C1 49 +09: 97 E5 14 72 7F 1A 14 72 => check +10: 82 C7 90 36 21 03 FF 17 +11: E2 F8 CC 91 3C 37 CC 91 => bind 4 bytes group swapped +12: AD 39 A2 0F 9B C5 A1 0F => 01 4 bytes group swapped +13: D2 8F B1 2A EF 64 B0 2A => 02 4 bytes group swapped +14: DD 26 7C 50 66 CD 7C 50 => 03 4 bytes group swapped +... +19: 62 DF C1 49 DF B1 C0 49 => 08 4 bytes group swapped +20: 00 00 00 33 DE AD BA BE ??over?? +*/ + #endif From 8ac53657ec6609fbefe93d73e027485258ba7f10 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 12:06:37 +0100 Subject: [PATCH 06/19] Kyosho updqte fixed crash --- Multiprotocol/A7105_SPI.ino | 8 ++++---- Multiprotocol/Kyosho_a7105.ino | 8 ++++---- Multiprotocol/Multiprotocol.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Multiprotocol/A7105_SPI.ino b/Multiprotocol/A7105_SPI.ino index 5a5927fcb..b6fe37355 100644 --- a/Multiprotocol/A7105_SPI.ino +++ b/Multiprotocol/A7105_SPI.ino @@ -418,10 +418,10 @@ void A7105_Init(void) #ifdef KYOSHO_A7105_INO if(protocol==PROTO_KYOSHO) { - if(sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO) - A7105_Regs=(uint8_t*)KYOSHO_A7105_regs; - else + if(sub_protocol==KYOSHO_HYPE) A7105_Regs=(uint8_t*)KYOSHO_HYPE_A7105_regs; + else //FHSS && SYNCRO + A7105_Regs=(uint8_t*)KYOSHO_A7105_regs; } #endif } @@ -446,7 +446,7 @@ void A7105_Init(void) } A7105_Strobe(A7105_STANDBY); - if(protocol==PROTO_KYOSHO && (sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO)) + if(protocol==PROTO_KYOSHO && sub_protocol!=KYOSHO_HYPE) {//strange calibration... //IF Filter Bank Calibration A7105_WriteReg(A7105_02_CALC,0x0F); diff --git a/Multiprotocol/Kyosho_a7105.ino b/Multiprotocol/Kyosho_a7105.ino index 2618d0957..90b8a1be4 100644 --- a/Multiprotocol/Kyosho_a7105.ino +++ b/Multiprotocol/Kyosho_a7105.ino @@ -59,7 +59,7 @@ static void __attribute__((unused)) KYOSHO_send_packet() packet[ 0] = 0x58; // normal packet //FHSS 14 channels: steering, throttle, ... //Syncro 6 channels: steering, throttle, ... - for(uint8_t i = 0; i < sub_protocol==KYOSHO_FHSS?14:6; i++) + for(uint8_t i = 0; i < (sub_protocol==KYOSHO_FHSS?14:6); i++) { uint16_t temp=convert_channel_ppm(i); packet[9 + i*2]=temp&0xFF; // low byte of servo timing(1000-2000us) @@ -159,10 +159,10 @@ uint16_t KYOSHO_callback() telemetry_set_input_sync(packet_period); #endif } - if(sub_protocol==KYOSHO_FHSS || sub_protocol==KYOSHO_SYNCRO) - KYOSHO_send_packet(); - else//HYPE + if(sub_protocol==KYOSHO_HYPE) KYOSHO_hype_send_packet(); + else //FHSS && SYNCRO + KYOSHO_send_packet(); return packet_period; } diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 64ef8eefa..91676a938 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 45 +#define VERSION_PATCH_LEVEL 46 #define MODE_SERIAL 0 From 75a46858da05565ce83c6d226211b3e7d4a04d33 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 12:25:25 +0100 Subject: [PATCH 07/19] Update Kyosho_a7105.ino --- Multiprotocol/Kyosho_a7105.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Kyosho_a7105.ino b/Multiprotocol/Kyosho_a7105.ino index 90b8a1be4..c8dd9e8dd 100644 --- a/Multiprotocol/Kyosho_a7105.ino +++ b/Multiprotocol/Kyosho_a7105.ino @@ -59,7 +59,7 @@ static void __attribute__((unused)) KYOSHO_send_packet() packet[ 0] = 0x58; // normal packet //FHSS 14 channels: steering, throttle, ... //Syncro 6 channels: steering, throttle, ... - for(uint8_t i = 0; i < (sub_protocol==KYOSHO_FHSS?14:6); i++) + for(uint8_t i = 0; i < 14; i++) //needed?: i < (sub_protocol==KYOSHO_FHSS?14:6); i++) { uint16_t temp=convert_channel_ppm(i); packet[9 + i*2]=temp&0xFF; // low byte of servo timing(1000-2000us) @@ -67,7 +67,7 @@ static void __attribute__((unused)) KYOSHO_send_packet() } if(sub_protocol==KYOSHO_SYNCRO) { - memcpy(&packet[21],&hopping_frequency[11],6); + //memcpy(&packet[21],&hopping_frequency[11],6); // needed? packet[34] = 0x0F; packet[36] = 0x0F; } From 5af246bba0566c436eac729098693843574ba7b4 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 12:33:21 +0100 Subject: [PATCH 08/19] Update _Config.h --- Multiprotocol/_Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 32fc041cb..664815ad8 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -255,7 +255,7 @@ #define ZSX_NRF24L01_INO //The protocols below need either a CC2500 or NRF24L01 to be installed -#define BLUEFLY_CCNRF_INO +//#define BLUEFLY_CCNRF_INO #define GD00X_CCNRF_INO #define KF606_CCNRF_INO #define MJXQ_CCNRF_INO From a90e1f2d3a26b65282190edf75f4518509cedf63 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 14:36:38 +0100 Subject: [PATCH 09/19] Update Bluefly_ccnrf.ino Exclude this protocol since it's not working --- Multiprotocol/Bluefly_ccnrf.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiprotocol/Bluefly_ccnrf.ino b/Multiprotocol/Bluefly_ccnrf.ino index 19d64b175..794ce2708 100644 --- a/Multiprotocol/Bluefly_ccnrf.ino +++ b/Multiprotocol/Bluefly_ccnrf.ino @@ -14,7 +14,7 @@ */ // compatible with BLUEFLY HP100 -#if defined(BLUEFLY_CCNRF_INO) +#if 0 //defined(BLUEFLY_CCNRF_INO) #include "iface_nrf250k.h" From 69484b52780081d9c741a885240d685c3e81cb4f Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 14:42:24 +0100 Subject: [PATCH 10/19] Second try --- Multiprotocol/Bluefly_ccnrf.ino | 2 +- Multiprotocol/_Config.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Multiprotocol/Bluefly_ccnrf.ino b/Multiprotocol/Bluefly_ccnrf.ino index 794ce2708..19d64b175 100644 --- a/Multiprotocol/Bluefly_ccnrf.ino +++ b/Multiprotocol/Bluefly_ccnrf.ino @@ -14,7 +14,7 @@ */ // compatible with BLUEFLY HP100 -#if 0 //defined(BLUEFLY_CCNRF_INO) +#if defined(BLUEFLY_CCNRF_INO) #include "iface_nrf250k.h" diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 664815ad8..b861889c3 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -255,7 +255,6 @@ #define ZSX_NRF24L01_INO //The protocols below need either a CC2500 or NRF24L01 to be installed -//#define BLUEFLY_CCNRF_INO #define GD00X_CCNRF_INO #define KF606_CCNRF_INO #define MJXQ_CCNRF_INO From ce75dd3355b75534a94d3fbac67766803002110c Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 30 Jan 2024 14:53:28 +0100 Subject: [PATCH 11/19] Kyosho FHSS/SYNCRO cleanup --- Multiprotocol/Kyosho_a7105.ino | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Multiprotocol/Kyosho_a7105.ino b/Multiprotocol/Kyosho_a7105.ino index c8dd9e8dd..b2608c59e 100644 --- a/Multiprotocol/Kyosho_a7105.ino +++ b/Multiprotocol/Kyosho_a7105.ino @@ -34,11 +34,6 @@ static void __attribute__((unused)) KYOSHO_send_packet() //unknown may be RX ID on some other remotes memset(packet+5,0xFF,4); - //unknwon but for Syncro the same values are used for bind and normal - packet[27] = sub_protocol==KYOSHO_FHSS?0x05:0x07; // Syncro is 7 - packet[28] = 0x00; - memset(packet+29,0xFF,8); - if(IS_BIND_IN_PROGRESS) { packet[ 0] = 0xBC; // bind indicator @@ -48,6 +43,11 @@ static void __attribute__((unused)) KYOSHO_send_packet() //RF table for(uint8_t i=0; i<16;i++) packet[i+11]=hopping_frequency[i+(packet[9]<<4)]; + //TX type + packet[27] = sub_protocol==KYOSHO_FHSS ? 0x05:0x07; // FHSS is 5 and Syncro is 7 + //Unknown + packet[28] = 0x00; + memset(packet+29,0xFF,8); //frequency hop during bind if(packet[9]) rf_ch_num=0x8C; @@ -59,18 +59,21 @@ static void __attribute__((unused)) KYOSHO_send_packet() packet[ 0] = 0x58; // normal packet //FHSS 14 channels: steering, throttle, ... //Syncro 6 channels: steering, throttle, ... - for(uint8_t i = 0; i < 14; i++) //needed?: i < (sub_protocol==KYOSHO_FHSS?14:6); i++) + for(uint8_t i = 0; i < 14; i++) //needed? i < (sub_protocol==KYOSHO_FHSS?14:6); i++) { - uint16_t temp=convert_channel_ppm(i); - packet[9 + i*2]=temp&0xFF; // low byte of servo timing(1000-2000us) - packet[10 + i*2]=(temp>>8)&0xFF; // high byte of servo timing(1000-2000us) - } - if(sub_protocol==KYOSHO_SYNCRO) - { - //memcpy(&packet[21],&hopping_frequency[11],6); // needed? - packet[34] = 0x0F; - packet[36] = 0x0F; + uint16_t temp = convert_channel_ppm(i); + packet[ 9 + i*2] = temp&0xFF; // low byte of servo timing(1000-2000us) + packet[10 + i*2] = (temp>>8)&0xFF; // high byte of servo timing(1000-2000us) } + // if(sub_protocol==KYOSHO_SYNCRO) // needed? + // { + // memcpy(&packet[21],&hopping_frequency[11],6); + // packet[27] = 0x07; + // packet[28] = 0x00; + // memset(packet+29,0xFF,8); + // packet[34] = 0x0F; + // packet[36] = 0x0F; + // } rf_ch_num=hopping_frequency[hopping_frequency_no]; hopping_frequency_no++; packet[34] |= (hopping_frequency_no&0x0F)<<4; From cdabde5d676e5d2d378de0b58ee11696a1367fcc Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 31 Jan 2024 19:22:36 +0100 Subject: [PATCH 12/19] Kyosho FHSS and Syncro Automatically binding a FHSS or a Syncro RX using FHSS --- Lua_scripts/MultiChan.txt | 1 - Multiprotocol/Kyosho_a7105.ino | 4 ++-- Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Protos.ino | 4 ++-- Multiprotocol/Multiprotocol.h | 7 +++---- Multiprotocol/_Config.h | 1 - Protocols_Details.md | 13 +++---------- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index b761af7af..8d7835c80 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -123,7 +123,6 @@ 9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim 73,0,Kyosho,FHSS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 73,1,Kyosho,Hype,0,CH5,CH6 -73,2,Kyosho,Syncro,0,CH5,CH6 18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate 18,1,MJXQ,X600,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate 18,2,MJXQ,X800,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate diff --git a/Multiprotocol/Kyosho_a7105.ino b/Multiprotocol/Kyosho_a7105.ino index b2608c59e..0711fd442 100644 --- a/Multiprotocol/Kyosho_a7105.ino +++ b/Multiprotocol/Kyosho_a7105.ino @@ -44,7 +44,7 @@ static void __attribute__((unused)) KYOSHO_send_packet() for(uint8_t i=0; i<16;i++) packet[i+11]=hopping_frequency[i+(packet[9]<<4)]; //TX type - packet[27] = sub_protocol==KYOSHO_FHSS ? 0x05:0x07; // FHSS is 5 and Syncro is 7 + packet[27] = (bind_counter & 0x40) ? 0x05:0x07; // FHSS is 5 and Syncro is 7 //Unknown packet[28] = 0x00; memset(packet+29,0xFF,8); @@ -185,7 +185,7 @@ void KYOSHO_init() } #endif #ifdef KYOSHO_FORCE_ID_SYNCRO - if(sub_protocol==KYOSHO_SYNCRO) + if(sub_protocol==KYOSHO_FHSS) { memcpy(rx_tx_addr,"\x00\xC2\x24\x00",4); memcpy(hopping_frequency,"\x73\x12\x7D\x88\x63\x4A\x8D\x60\x57\x16\x5D\x8B\x25\x53\x6E\x3C\x41\x70\x20\x83\x2A\x19\x94\x2F\x91\x4C\x47\x36\x78\x10\x5A\x31",32); diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index 8f1cfcb4e..f420d6a74 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -70,7 +70,7 @@ 70,DSM_RX,Multi,CloneTX,EraseTX,CPPM 71,JJRC345,JJRC345,SkyTmblr 72,Q90C -73,Kyosho,FHSS,Hype,Syncro +73,Kyosho,FHSS,Hype 74,RadioLink,Surface,Air,DumboRC 75,--- 76,Realacc,R11 diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index 4aac1679b..32bd83efa 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -169,7 +169,7 @@ const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24"; const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC"; const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC"; const char STR_SUBTYPE_REALACC[] = "\x03""R11"; -const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype""Sync"; +const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype"; const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17"; const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS"; const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr"; @@ -379,7 +379,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_KN, STR_KN, STR_SUBTYPE_KN, 2, OPTION_NONE, 0, 0, SW_NRF, KN_init, KN_callback }, #endif #if defined(KYOSHO_A7105_INO) - {PROTO_KYOSHO, STR_KYOSHO, STR_SUBTYPE_KYOSHO, 3, OPTION_NONE, 0, 1, SW_A7105, KYOSHO_init, KYOSHO_callback }, + {PROTO_KYOSHO, STR_KYOSHO, STR_SUBTYPE_KYOSHO, 2, OPTION_NONE, 0, 1, SW_A7105, KYOSHO_init, KYOSHO_callback }, #endif #if defined(KYOSHO2_NRF24L01_INO) {PROTO_KYOSHO2, STR_KYOSHO2, STR_SUBTYPE_KYOSHO2, 1, OPTION_NONE, 0, 0, SW_NRF, KYOSHO2_init, KYOSHO2_callback }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 91676a938..972600047 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 46 +#define VERSION_PATCH_LEVEL 47 #define MODE_SERIAL 0 @@ -437,9 +437,8 @@ enum HEIGHT }; enum KYOSHO { - KYOSHO_FHSS = 0, - KYOSHO_HYPE = 1, - KYOSHO_SYNCRO = 2, + KYOSHO_FHSS = 0, + KYOSHO_HYPE = 1, }; enum JJRC345 { diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index b861889c3..986d6c7f3 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -733,7 +733,6 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PROTO_KYOSHO KYOSHO_FHSS KYOSHO_HYPE - KYOSHO_SYNCRO PROTO_KYOSHO2 NONE PROTO_LOLI diff --git a/Protocols_Details.md b/Protocols_Details.md index 94a7b0314..ddd60653f 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -326,7 +326,9 @@ CH1|CH2|CH3|CH4 ## Kyosho - *73* ### Sub_protocol FHSS - *0* -Surface protocol called FHSS introduced in 2017. Transmitter: KT-531P. Models: Mini-Z +Surface protocol called FHSS introduced in 2017. Transmitter: KT-531P. Models: Mini-Z. + +Surface protocol called Syncro. TX: KT-331, RX: KR-331 Extended limits supported @@ -343,15 +345,6 @@ A|E|T|R|CH5|CH6 RX output will match the Hype standard AETR independently of the input configuration AETR, RETA... unless on OpenTX 2.3.3+ you use the "Disable channel mapping" feature on the GUI. -### Sub_protocol Syncro - *2* -Surface protocol called Syncro. TX: KT-331, RX: KR-331 - -Extended limits supported - -CH1|CH2|CH3|CH4|CH5|CH6 ----|---|---|---|---|--- -STEERING|THROTTLE|CH3|CH4|CH5|CH6 - ## Pelikan - *60* Extended limits supported From 11ae26a431eaebc2b318a1cb66ee0003a7a01cd9 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 31 Jan 2024 19:27:54 +0100 Subject: [PATCH 13/19] 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 ddd60653f..f897fab08 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -113,7 +113,7 @@ CFlie|38|CFlie||||||||NRF24L01| [JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297 [KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297 [KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01| -[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|Syncro||||||A7105| +[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105| [Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01| [LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01| [Losi](Protocols_Details.md#Losi---89)|89|||||||||CYRF6936| From 4a66ae64c6113cc1cb00889b7eb359fec6c1f899 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 6 Feb 2024 12:06:34 +0100 Subject: [PATCH 14/19] Update Protocols_Details.md (#940) --- Protocols_Details.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index f897fab08..f6f61f6c5 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1444,13 +1444,13 @@ Channels 14 and 15 (ANAAUX1 and ANAAUX2) only available with analog aux channel ### Sub_protocol BAYANG - *0* Models: Eachine H8(C) mini, BayangToys X6/X7/X9, JJRC JJ850, Floureon H101 ... -Option=0 -> normal Bayang protocol +Option=0 or Telemetry = Off -> normal Bayang protocol -Option=1 -> enable telemetry with [Silverxxx firmware](https://github.com/silver13/H101-acro/tree/master). Value returned to the TX using FrSkyD Hub are RX RSSI, TX RSSI, A1=uncompensated battery voltage (set the ratio to 5.0 and adjust with offset), A2=compensated battery voltage (set the ratio to 5.0 and adjust with offset) and if supported AccX=P, AccY=I, ACCZ=D (which you can rename after the sensors discovery) +Option=1 or Telemetry = On -> enable telemetry with [Silverxxx firmware](https://github.com/silver13/H101-acro/tree/master). Value returned to the TX using FrSkyD Hub are RX RSSI, TX RSSI, A1=uncompensated battery voltage (set the ratio to 5.0 and adjust with offset), A2=compensated battery voltage (set the ratio to 5.0 and adjust with offset) and if supported AccX=P, AccY=I, ACCZ=D (which you can rename after the sensors discovery) -Option=2 -> enable analog aux channels with [NFE Silverware firmware](https://github.com/NotFastEnuf/NFE_Silverware). Two otherwise static bytes in the protocol overridden to add two 'analog' (non-binary) auxiliary channels. +Option=2 or Telemetry = Off+AUX -> enable analog aux channels with [NFE Silverware firmware](https://github.com/NotFastEnuf/NFE_Silverware). Two otherwise static bytes in the protocol overridden to add two 'analog' (non-binary) auxiliary channels. -Option=3 -> both Silverware telemetry and analog aux channels enabled. +Option=3 or Telemetry = On+AUX-> both Silverware telemetry and analog aux channels enabled. ### Sub_protocol H8S3D - *1* Model: H8S 3D From 31a9f6860ddfe75e9e89285c31a10a7742c08d9b Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 15 Feb 2024 15:51:20 +0100 Subject: [PATCH 15/19] New protocol SGF22 Only 1 ID! --- Lua_scripts/MultiChan.txt | 1 + Multiprotocol/Multi.txt | 1 + Multiprotocol/Multi_Protos.ino | 4 + Multiprotocol/Multiprotocol.h | 3 +- Multiprotocol/SGF22_nrf24l01.ino | 132 +++++++++++++++++++++++++++++++ Multiprotocol/_Config.h | 1 + 6 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 Multiprotocol/SGF22_nrf24l01.ino diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 8d7835c80..4af68fa98 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -212,3 +212,4 @@ 94,0,Scorpio 95,0,Bluefly,HP100,0,CH5,CH6,CH7,CH8 96,0,BumbleB +97,0,SGF22,Std,1,MODE,FLIP,LED diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index f420d6a74..c7244bf23 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -93,3 +93,4 @@ 94,Scorpio 95,BlueFly 96,BumbleB +97,SGF22 diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index 32bd83efa..3ffc349f3 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -108,6 +108,7 @@ const char STR_XERALL[] ="Xerall"; const char STR_SCORPIO[] ="Scorpio"; const char STR_BLUEFLY[] ="BlueFly"; const char STR_BUMBLEB[] ="BumbleB"; +const char STR_SGF22[] ="SGF22"; const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20"; const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501"; @@ -444,6 +445,9 @@ const mm_protocol_definition multi_protocols[] = { #if defined(SCORPIO_CYRF6936_INO) {PROTO_SCORPIO, STR_SCORPIO, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, SCORPIO_init, SCORPIO_callback }, #endif + #if defined(SGF22_NRF24L01_INO) + {PROTO_SGF22, STR_SGF22, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback }, + #endif #if defined(SHENQI_NRF24L01_INO) {PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback }, #endif diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 972600047..47c6b8ef8 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 47 +#define VERSION_PATCH_LEVEL 48 #define MODE_SERIAL 0 @@ -124,6 +124,7 @@ enum PROTOCOLS PROTO_SCORPIO = 94, // =>CYRF6936 PROTO_BLUEFLY = 95, // =>CC2500 & NRF24L01 PROTO_BUMBLEB = 96, // =>CC2500 & NRF24L01 + PROTO_SGF22 = 97, // =>NRF24L01 PROTO_NANORF = 126, // =>NRF24L01 diff --git a/Multiprotocol/SGF22_nrf24l01.ino b/Multiprotocol/SGF22_nrf24l01.ino new file mode 100644 index 000000000..b1f92a97c --- /dev/null +++ b/Multiprotocol/SGF22_nrf24l01.ino @@ -0,0 +1,132 @@ +/* + 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 SGF22 R11 + +#if defined(SGF22_NRF24L01_INO) + +#include "iface_xn297.h" + +#define FORCE_SGF22_ORIGINAL_ID + +#define SGF22_PACKET_PERIOD 11950 //10240 +#define SGF22_BIND_RF_CHANNEL 78 +#define SGF22_PAYLOAD_SIZE 12 +#define SGF22_BIND_COUNT 50 +#define SGF22_RF_NUM_CHANNELS 4 + +static void __attribute__((unused)) SGF22_send_packet() +{ + if(IS_BIND_IN_PROGRESS) + { + packet[0] = 0x5B; + packet[8] = 0x00; // ??? do they have to be 0 for bind to succeed ? + packet[9] = 0x00; // ??? do they have to be 0 for bind to succeed ? + packet[10] = 0xAA; + packet[11] = 0x55; + } + else + { + //hop + XN297_Hopping(packet_sent & 0x03); // ??? from the dumps I can't really say how hop and seq are sync, there could be an offset (0,1,2,3)... + if( (packet_sent & 0x03) == 0x02) + packet_count = packet_sent; + packet_sent++; + if(packet_sent > 0x7B) + packet_sent = 0; + //packet + packet[0] = 0x1B; + packet[8] = 0x04 | GET_FLAG(CH6_SW, 0x08); // roll + if(Channel_data[CH5] > CHANNEL_MIN_COMMAND) + packet[8] |= 0x40; // mode 1 - 6g + if(Channel_data[CH5] > CHANNEL_MAX_COMMAND) + packet[8] |= 0x80; // mode 0 - vertical + packet[9] = GET_FLAG(CH7_SW, 0x40); // light + packet[10] = 0x42; // no fine tune + packet[11] = 0x10; // no fine tune + } + packet[1] = packet_count; // sequence + packet[2] = rx_tx_addr[2]; + packet[3] = rx_tx_addr[3]; + packet[4] = convert_channel_8b(THROTTLE); + packet[5] = convert_channel_8b(RUDDER); + packet[6] = convert_channel_8b(ELEVATOR); + packet[7] = convert_channel_8b(AILERON); + + XN297_SetPower(); + XN297_SetTxRxMode(TX_EN); + XN297_WriteEnhancedPayload(packet, SGF22_PAYLOAD_SIZE,0); + #if 0 + debug_time(""); + for(uint8_t i=0; i21=0x15,52=0x34,36=0x24,68=0x44 + #endif +} + +static void __attribute__((unused)) SGF22_RF_init() +{ + XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M); + XN297_SetTXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", 5); + XN297_RFChannel(SGF22_BIND_RF_CHANNEL); // Set bind channel +} + +uint16_t SGF22_callback() +{ + if(phase == 0) + { + phase++; + #ifdef MULTI_SYNC + telemetry_set_input_sync(SGF22_PACKET_PERIOD); + #endif + SGF22_send_packet(); + if(IS_BIND_IN_PROGRESS) + { + if(--bind_counter==0) + BIND_DONE; + } + } + else + {//send 3 times in total the same packet + NRF24L01_Strobe(REUSE_TX_PL); + phase++; + if(phase > 2) + { + phase = 0; + return SGF22_PACKET_PERIOD - 2*1550; + } + } + return 1550; +} + +void SGF22_init() +{ + BIND_IN_PROGRESS; // autobind protocol + SGF22_initialize_txid(); + SGF22_RF_init(); + bind_counter=SGF22_BIND_COUNT; + packet_sent = packet_count = 0x26; + phase = 0; +} + +#endif diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 986d6c7f3..a88b6500f 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -245,6 +245,7 @@ #define POTENSIC_NRF24L01_INO #define PROPEL_NRF24L01_INO #define REALACC_NRF24L01_INO +#define SGF22_NRF24L01_INO #define SHENQI_NRF24L01_INO #define SYMAX_NRF24L01_INO #define TIGER_NRF24L01_INO From dd7ee7bdce50f39c0a6f4d816af9d9b914ac0759 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 15 Feb 2024 16:20:37 +0100 Subject: [PATCH 16/19] SGF22 --- Multiprotocol/SGF22_nrf24l01.ino | 4 +++- Protocols_Details.md | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/SGF22_nrf24l01.ino b/Multiprotocol/SGF22_nrf24l01.ino index b1f92a97c..4ddb01b4e 100644 --- a/Multiprotocol/SGF22_nrf24l01.ino +++ b/Multiprotocol/SGF22_nrf24l01.ino @@ -108,7 +108,9 @@ uint16_t SGF22_callback() } else {//send 3 times in total the same packet - NRF24L01_Strobe(REUSE_TX_PL); + #ifdef NRF24L01_INSTALLED + NRF24L01_Strobe(REUSE_TX_PL); + #endif phase++; if(phase > 2) { diff --git a/Protocols_Details.md b/Protocols_Details.md index f6f61f6c5..03611b500 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -136,6 +136,7 @@ CFlie|38|CFlie||||||||NRF24L01| [Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|XN297 [Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500| [Scorpio](Protocols_Details.md#Scorpio---94)|94|||||||||CYRF6936| +[SGF22](Protocols_Details.md#SGF22---97)|97|SGF22||||||||NRF24L01|XN297 [Shenqi](Protocols_Details.md#Shenqi---19)|19|Shenqi||||||||NRF24L01|LT8900 [Skyartec](Protocols_Details.md#Skyartec---68)|68|||||||||CC2500|CC2500 [SLT](Protocols_Details.md#SLT---11)|11|SLT_V1|SLT_V2|Q100|Q200|MR100||||NRF24L01|CC2500 @@ -1934,6 +1935,15 @@ A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK ### Sub_protocol FAST - *0* ### Sub_protocol SLOW - *1* +## SGF22 - *97* +Autobind protocol + +Model: SGF22 + +CH1|CH2|CH3|CH4|CH5|CH6|CH7 +---|---|---|---|---|---|--- +A|E|T|R|MODE|FLIP|LIGHT + ## Shenqi - *19* Autobind protocol From de610b53fccf12b711bb33a19910532075ac3985 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 15 Feb 2024 16:28:52 +0100 Subject: [PATCH 17/19] SGF22.1 --- Multiprotocol/SGF22_nrf24l01.ino | 4 +--- Multiprotocol/Validate.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Multiprotocol/SGF22_nrf24l01.ino b/Multiprotocol/SGF22_nrf24l01.ino index 4ddb01b4e..b1f92a97c 100644 --- a/Multiprotocol/SGF22_nrf24l01.ino +++ b/Multiprotocol/SGF22_nrf24l01.ino @@ -108,9 +108,7 @@ uint16_t SGF22_callback() } else {//send 3 times in total the same packet - #ifdef NRF24L01_INSTALLED - NRF24L01_Strobe(REUSE_TX_PL); - #endif + NRF24L01_Strobe(REUSE_TX_PL); phase++; if(phase > 2) { diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index e805be85f..57484347b 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -330,6 +330,7 @@ #undef POTENSIC_NRF24L01_INO #undef PROPEL_NRF24L01_INO #undef REALACC_NRF24L01_INO + #undef SGF22_NRF24L01_INO #undef SHENQI_NRF24L01_INO #undef SYMAX_NRF24L01_INO #undef TIGER_NRF24L01_INO From 724abbc9355e96b5c5a54710cee16b90e8a41244 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 15 Feb 2024 18:24:58 +0100 Subject: [PATCH 18/19] SGF22.2 --- Lua_scripts/MultiChan.txt | 2 +- Multiprotocol/SGF22_nrf24l01.ino | 31 ++++++++++++++++++++----------- Protocols_Details.md | 8 +++++--- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 4af68fa98..da7565beb 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -212,4 +212,4 @@ 94,0,Scorpio 95,0,Bluefly,HP100,0,CH5,CH6,CH7,CH8 96,0,BumbleB -97,0,SGF22,Std,1,MODE,FLIP,LED +97,0,SGF22,Std,1,Mode,Flip,LED,Pict diff --git a/Multiprotocol/SGF22_nrf24l01.ino b/Multiprotocol/SGF22_nrf24l01.ino index b1f92a97c..90bb338b0 100644 --- a/Multiprotocol/SGF22_nrf24l01.ino +++ b/Multiprotocol/SGF22_nrf24l01.ino @@ -26,20 +26,27 @@ Multiprotocol is distributed in the hope that it will be useful, #define SGF22_BIND_COUNT 50 #define SGF22_RF_NUM_CHANNELS 4 +#define SGF22_FLAG_LIGHT 0x04 +#define SGF22_FLAG_6G 0x40 +#define SGF22_FLAG_VERTICAL 0xC0 +#define SGF22_FLAG_3D 0x00 +#define SGF22_FLAG_ROLL 0x08 +#define SGF22_FLAG_PHOTO 0x40 + static void __attribute__((unused)) SGF22_send_packet() { if(IS_BIND_IN_PROGRESS) { - packet[0] = 0x5B; - packet[8] = 0x00; // ??? do they have to be 0 for bind to succeed ? - packet[9] = 0x00; // ??? do they have to be 0 for bind to succeed ? + packet[ 0] = 0x5B; + packet[ 8] = 0x00; // ??? do they have to be 0 for bind to succeed ? + packet[ 9] = 0x00; // ??? do they have to be 0 for bind to succeed ? packet[10] = 0xAA; packet[11] = 0x55; } else { //hop - XN297_Hopping(packet_sent & 0x03); // ??? from the dumps I can't really say how hop and seq are sync, there could be an offset (0,1,2,3)... + XN297_Hopping(packet_sent & 0x03); // ??? from the dumps I can't really say how hop and seq are sync, there could be an offset (0,1,2,3)... if( (packet_sent & 0x03) == 0x02) packet_count = packet_sent; packet_sent++; @@ -47,16 +54,18 @@ static void __attribute__((unused)) SGF22_send_packet() packet_sent = 0; //packet packet[0] = 0x1B; - packet[8] = 0x04 | GET_FLAG(CH6_SW, 0x08); // roll + packet[8] = SGF22_FLAG_3D // default + | GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll + | GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT); // press up throttle trim for light if(Channel_data[CH5] > CHANNEL_MIN_COMMAND) - packet[8] |= 0x40; // mode 1 - 6g + packet[8] |= SGF22_FLAG_6G; // mode 1 - 6g if(Channel_data[CH5] > CHANNEL_MAX_COMMAND) - packet[8] |= 0x80; // mode 0 - vertical - packet[9] = GET_FLAG(CH7_SW, 0x40); // light - packet[10] = 0x42; // no fine tune - packet[11] = 0x10; // no fine tune + packet[8] |= SGF22_FLAG_VERTICAL; // mode 0 - vertical + GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO); // press down throttle trim for photo + packet[10] = 0x42; // no fine tune + packet[11] = 0x10; // no fine tune } - packet[1] = packet_count; // sequence + packet[1] = packet_count; // sequence packet[2] = rx_tx_addr[2]; packet[3] = rx_tx_addr[3]; packet[4] = convert_channel_8b(THROTTLE); diff --git a/Protocols_Details.md b/Protocols_Details.md index 03611b500..0ecedb37f 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1938,11 +1938,13 @@ A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK ## SGF22 - *97* Autobind protocol +Only 1 ID !!! Need more TX dumps. + Model: SGF22 -CH1|CH2|CH3|CH4|CH5|CH6|CH7 ----|---|---|---|---|---|--- -A|E|T|R|MODE|FLIP|LIGHT +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8 +---|---|---|---|---|---|---|--- +A|E|T|R|MODE|FLIP|LIGHT|PHOTO ## Shenqi - *19* Autobind protocol From 53d5684dfd8be99b8ed9a35e64bbde5b501323a4 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 15 Feb 2024 20:52:01 +0100 Subject: [PATCH 19/19] KN: additional trim and flag --- Lua_scripts/MultiChan.txt | 4 ++-- Multiprotocol/KN_nrf24l01.ino | 22 ++++++++-------------- Protocols_Details.md | 6 +++--- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index da7565beb..3303ca52d 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -119,8 +119,8 @@ 49,0,KF606,KF606,1,Trim 49,1,KF606,MIG320,1,Trim,LED 49,2,KF606,ZCZ50,1,Trim,UNK -9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim +9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim,Rtrim,Hover +9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim,Rtrim,Hover 73,0,Kyosho,FHSS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 73,1,Kyosho,Hype,0,CH5,CH6 18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate diff --git a/Multiprotocol/KN_nrf24l01.ino b/Multiprotocol/KN_nrf24l01.ino index ddd59ec36..4434b5bdd 100644 --- a/Multiprotocol/KN_nrf24l01.ino +++ b/Multiprotocol/KN_nrf24l01.ino @@ -63,7 +63,7 @@ enum { KN_FLAG_DR = 0x01, // Dual Rate: 1 - full range KN_FLAG_TH = 0x02, // Throttle Hold: 1 - hold KN_FLAG_IDLEUP = 0x04, // Idle up: 1 - 3D - KN_FLAG_RES1 = 0x08, + KN_FLAG_RES1 = 0x08, // HoverDebugging KN_FLAG_RES2 = 0x10, KN_FLAG_RES3 = 0x20, KN_FLAG_GYRO3 = 0x40, // 0 - 6G mode, 1 - 3G mode @@ -141,19 +141,13 @@ static void __attribute__((unused)) kn_update_packet_control_data() packet[8] = convert_channel_16b_limit(CH9,0,200); // 0x64; // T packet[9] = convert_channel_16b_limit(CH10,0,200); // 0x64; // A packet[10] = convert_channel_16b_limit(CH11,0,200); // 0x64; // E - packet[11] = 0x64; // R - - flags=0; - if (CH5_SW) - flags = KN_FLAG_DR; - if (CH6_SW) - flags |= KN_FLAG_TH; - if (CH7_SW) - flags |= KN_FLAG_IDLEUP; - if (CH8_SW) - flags |= KN_FLAG_GYRO3; - - packet[12] = flags; + packet[11] = convert_channel_16b_limit(CH12,0,200); // 0x64; // R + + packet[12] = GET_FLAG(CH5_SW, KN_FLAG_DR) + |GET_FLAG(CH6_SW, KN_FLAG_TH) + |GET_FLAG(CH7_SW, KN_FLAG_IDLEUP) + |GET_FLAG(CH8_SW, KN_FLAG_GYRO3) + |GET_FLAG(CH13_SW, KN_FLAG_RES1); //Hover debugging packet[13] = 0x00; if(sub_protocol==WLTOYS) diff --git a/Protocols_Details.md b/Protocols_Details.md index 0ecedb37f..ce7dc8c37 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1756,9 +1756,9 @@ CH1|CH2|CH3|CH4|CH5 | | |T|R|AUX ## KN - *9* -CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11 ----|---|---|---|---|---|---|---|---|----|---- -A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13 +---|---|---|---|---|---|---|---|---|----|----|----|---- +A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim|Rtrim|HoverDebugging Dual Rate: +100%=full range, Throttle Hold: +100%=hold, Idle Up: +100%=3D, GYRO: -100%=6G, +100%=3G