From e0299f6c7dca43350d20426e4d70072bb79ee6f5 Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:03:39 -0700 Subject: [PATCH 1/5] Update _Config.h (#1019) add sub protocol "J20" to "SGF22" protocol --- Multiprotocol/_Config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 939a02370..6486d429a 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -817,6 +817,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PROTO_SGF22 SGF22 F22S + J20 PROTO_SHENQI NONE PROTO_SKYARTEC From 1b79d7f80f7ed4c98dcc708d10f5cc490cb1a1d1 Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:04:07 -0700 Subject: [PATCH 2/5] Update Multi.txt (#1020) add sub protocol "J20" to "SGF22" protocol --- Multiprotocol/Multi.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index fe010aaad..4db1a401e 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -93,6 +93,6 @@ 94,Scorpio 95,BlueFly 96,BumbleB -97,SGF22,F22,F22S +97,SGF22,F22,F22S,J20 98,Kyosho3 -99,XK2 \ No newline at end of file +99,XK2 From 58b19a213070a29ac7997fcdc7bae2cc96ff390c Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:04:45 -0700 Subject: [PATCH 3/5] Update Multi_Protos.ino (#1021) add sub protocol "J20" to "SGF22" protocol --- Multiprotocol/Multi_Protos.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index c02fadf69..a8cc6a241 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -180,7 +180,7 @@ const char STR_SUBTYPE_MOULDKG[] = "\x06""Analog""Digit\0"; const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0"; const char STR_SUBTYPE_E129[] = "\x04""E129""C186"; const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630""Q560"; -const char STR_SUBTYPE_SGF22[] = "\x04""F22\0""F22S"; +const char STR_SUBTYPE_SGF22[] = "\x04""F22\0""F22S""J20\0"; #define NO_SUBTYPE nullptr #ifdef SEND_CPPM @@ -455,7 +455,7 @@ const mm_protocol_definition multi_protocols[] = { {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, STR_SUBTYPE_SGF22, 2, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback }, + {PROTO_SGF22, STR_SGF22, STR_SUBTYPE_SGF22, 3, 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 }, @@ -590,4 +590,4 @@ uint16_t PROTOLIST_callback() } return 1000; } -#endif \ No newline at end of file +#endif From 10b230d2dd05dfffb672fc5713072f238df0a842 Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:05:12 -0700 Subject: [PATCH 4/5] Update Multiprotocol.h (#1022) add sub protocol "J20" to "SGF22" protocol --- Multiprotocol/Multiprotocol.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index fc655fa1e..943b107ad 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -485,6 +485,7 @@ enum SGF22 { SGF22_F22 = 0, SGF22_F22S = 1, + SGF22_J20 = 2, }; #define NONE 0 From f58f7800d2ccdab71b3486919c1e4e8a6049b864 Mon Sep 17 00:00:00 2001 From: rdba2k <90289517+rdba2k@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:11:19 -0700 Subject: [PATCH 5/5] Update SGF22_nrf24l01.ino (#1023) add sub protocol "J20" to "SGF22" protocol --- Multiprotocol/SGF22_nrf24l01.ino | 35 +++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Multiprotocol/SGF22_nrf24l01.ino b/Multiprotocol/SGF22_nrf24l01.ino index abfa05230..20a945e1d 100644 --- a/Multiprotocol/SGF22_nrf24l01.ino +++ b/Multiprotocol/SGF22_nrf24l01.ino @@ -12,7 +12,7 @@ Multiprotocol is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License along with Multiprotocol. If not, see . */ -// Compatible with SGF22, ParkTen F22S +// Compatible with SGF22, ParkTen F22S, KF700 J20 #if defined(SGF22_NRF24L01_INO) @@ -26,6 +26,7 @@ Multiprotocol is distributed in the hope that it will be useful, #define SGF22_BIND_COUNT 50 #define SGF22_RF_NUM_CHANNELS 4 #define SGF22_F22S_BIND_RF_CHANNEL 10 +#define SGF22_J20_BIND_RF_CHANNEL 28 //packet[8] #define SGF22_FLAG_3D 0x00 @@ -34,9 +35,12 @@ Multiprotocol is distributed in the hope that it will be useful, #define SGF22_FLAG_VIDEO 0x10 #define SGF22_FLAG_6G 0x40 #define SGF22_FLAG_VERTICAL 0xC0 + +#define SGF22_J20_FLAG_HORIZONTAL 0x80 + //packet[9] -#define SGF22_FLAG_PHOTO 0x40 -#define SGF22_FLAG_TRIMRESET 0x04 +#define SGF22_FLAG_PHOTO 0x40 // #define SGF22_J20_FLAG_INVERT 0x40 +#define SGF22_FLAG_TRIMRESET 0x04 static void __attribute__((unused)) SGF22_send_packet() { @@ -60,21 +64,23 @@ static void __attribute__((unused)) SGF22_send_packet() packet_sent = 0; //packet packet[0] = 0x1B; - packet[8] = SGF22_FLAG_3D // default - | GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll - | GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light - | GET_FLAG(CH9_SW, SGF22_FLAG_VIDEO); // push down throttle trim for video - if(Channel_data[CH5] > CHANNEL_MIN_COMMAND) - packet[8] |= SGF22_FLAG_6G; // mode 1 - 6g - if(Channel_data[CH5] > CHANNEL_MAX_COMMAND) - packet[8] |= SGF22_FLAG_VERTICAL; // mode 0 - vertical - packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO) // press in throttle trim for photo - | GET_FLAG(CH10_SW, SGF22_FLAG_TRIMRESET); // Both sticks down inwards + packet[8] = SGF22_FLAG_3D // CH5 -100%, F22 & F22S - 3D mode, J20 - Gyro off + | GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll + | GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light in the stock TX + | GET_FLAG(CH9_SW, SGF22_FLAG_VIDEO); // push down throttle trim for video in the stock TX + if(Channel_data[CH5] > CHANNEL_MAX_COMMAND) + packet[8] |= SGF22_FLAG_VERTICAL; // CH5 100%, vertical mode (torque) + else if(Channel_data[CH5] > CHANNEL_MIN_COMMAND ) + packet[8] |= ( sub_protocol == SGF22_J20 ? SGF22_J20_FLAG_HORIZONTAL : SGF22_FLAG_6G ); // CH5 0%, F22 & F22S - 6G mode, J20 - Horizontal mode + packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO) // F22: photo, press in throttle trim in the stock TX, J20: invert flight + | GET_FLAG(CH10_SW, SGF22_FLAG_TRIMRESET); // Both sticks down inwards in the stock TX packet[10] = 0x42; // no fine tune packet[11] = 0x10; // no fine tune } if(sub_protocol == SGF22_F22S) packet[0] += 6; + else if (sub_protocol == SGF22_J20) + packet[0] += 3; packet[1] = packet_count; // sequence packet[2] = rx_tx_addr[2]; packet[3] = rx_tx_addr[3]; @@ -134,7 +140,8 @@ 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(sub_protocol == SGF22_F22S ? SGF22_F22S_BIND_RF_CHANNEL : SGF22_BIND_RF_CHANNEL); // Set bind channel + const uint8_t bind_chan[SGF22_J20 + 1] = {SGF22_BIND_RF_CHANNEL, SGF22_F22S_BIND_RF_CHANNEL, SGF22_J20_BIND_RF_CHANNEL}; + XN297_RFChannel(bind_chan[sub_protocol]); // Set bind channel } uint16_t SGF22_callback()