From 95746f80a1b14cc6d3c507b73f918b17a1626e30 Mon Sep 17 00:00:00 2001 From: Arild Langseid Date: Sun, 19 Jan 2025 14:14:32 +0100 Subject: [PATCH] Add RF_SIM sub-protocol to SLT-protocol (#1061) * Added sub-protocol RF_SIM to the SLT protocol * fixed typo --------- Co-authored-by: Arild Langseid --- Lua_scripts/MultiChan.txt | 1 + Multiprotocol/Multi.txt | 2 +- Multiprotocol/Multi_Protos.ino | 4 ++-- Multiprotocol/Multiprotocol.h | 3 +++ Multiprotocol/SLT_ccnrf.ino | 11 ++++++++--- Multiprotocol/_Config.h | 2 ++ Protocols_Details.md | 19 ++++++++++++++++++- 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 94278c63b..ca45ba793 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -171,6 +171,7 @@ 11,3,SLT,Q200,0,Rates,n-a,CH7,CH8,Mode,VidOn,VidOff,Calib 11,4,SLT,MR100,0,Rates,n-a,CH7,CH8,Mode,Flip,Video,Pict 11,5,SLT,V1_4CH,0 +11,6,SLT,RF_SIM,0,CH5,CH6,CH7,CH8,CH9,CH10 10,0,Symax,Std,1,Flip,Rates,Pict,Video,HLess 10,1,Symax,X5C,1,Flip,Rates,Pict,Video,HLess 43,0,Traxxas,TQ,0 diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index d818124bd..ff6f3c73f 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -8,7 +8,7 @@ 8,YD717,YD717,SKYWLKR,SYMAX4,XINXUN,NIHUI 9,KN,WLTOYS,FEILUN 10,SymaX,SYMAX,SYMAX5C -11,SLT,SLT_V1,SLT_V2,Q100,Q200,MR100,V1_4CH +11,SLT,SLT_V1,SLT_V2,Q100,Q200,MR100,V1_4CH,RF_SIM 12,CX10,GREEN,BLUE,DM007,---,J3015_1,J3015_2,MK33041 13,CG023,CG023,YD829 14,Bayang,Bayang,H8S3D,X16_AH,IRDRONE,DHD_D4,QX100 diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index de023ba0a..bdb84eb28 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -132,7 +132,7 @@ const char STR_SUBTYPE_DEVO[] = "\x04""8ch\0""10ch""12ch""6ch\0""7ch\0"; const char STR_SUBTYPE_YD717[] = "\x07""Std\0 ""SkyWlkr""Syma X4""XINXUN\0""NIHUI\0 "; const char STR_SUBTYPE_KN[] = "\x06""WLtoys""FeiLun"; const char STR_SUBTYPE_SYMAX[] = "\x03""Std""X5C"; -const char STR_SUBTYPE_SLT[] = "\x06""V1_6ch""V2_8ch""Q100\0 ""Q200\0 ""MR100\0""V1_4ch"; +const char STR_SUBTYPE_SLT[] = "\x06""V1_6ch""V2_8ch""Q100\0 ""Q200\0 ""MR100\0""V1_4ch""RF_SIM"; const char STR_SUBTYPE_CX10[] = "\x07""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041"; const char STR_SUBTYPE_CG023[] = "\x05""Std\0 ""YD829"; const char STR_SUBTYPE_BAYANG[] = "\x07""Std\0 ""H8S3D\0 ""X16 AH\0""IRDrone""DHD D4\0""QX100\0 "; @@ -465,7 +465,7 @@ const mm_protocol_definition multi_protocols[] = { {PROTO_SKYARTEC, STR_SKYARTEC, NO_SUBTYPE, 0, OPTION_RFTUNE, 0, 1, SW_CC2500, SKYARTEC_init, SKYARTEC_callback }, #endif #if defined(SLT_CCNRF_INO) - {PROTO_SLT, STR_SLT, STR_SUBTYPE_SLT, 6, OPTION_RFTUNE, 0, 1, SW_NRF, SLT_init, SLT_callback }, + {PROTO_SLT, STR_SLT, STR_SUBTYPE_SLT, 7, OPTION_RFTUNE, 0, 1, SW_NRF, SLT_init, SLT_callback }, #endif #if defined(SYMAX_NRF24L01_INO) {PROTO_SYMAX, STR_SYMAX, STR_SUBTYPE_SYMAX, 2, OPTION_NONE, 0, 0, SW_NRF, SYMAX_init, SYMAX_callback }, diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 58ac49185..615136d13 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -209,6 +209,7 @@ enum SLT Q200 = 3, MR100 = 4, SLT_V1_4 = 5, + RF_SIM = 6, }; enum CX10 { @@ -1110,6 +1111,8 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- Q100 2 Q200 3 MR100 4 + SLT_V1_4CH 5 + RF_SIM 6 sub_protocol==E01X E012 0 E015 1 diff --git a/Multiprotocol/SLT_ccnrf.ino b/Multiprotocol/SLT_ccnrf.ino index a7c139ee6..9403f68d8 100644 --- a/Multiprotocol/SLT_ccnrf.ino +++ b/Multiprotocol/SLT_ccnrf.ino @@ -137,7 +137,7 @@ static void __attribute__((unused)) SLT_build_packet() for (uint8_t i = 0; i < 4; ++i) { uint16_t v = convert_channel_10b(sub_protocol != SLT_V1_4 ? CH_AETR[i] : i, false); - if(sub_protocol>SLT_V2 && (i==CH2 || i==CH3) && sub_protocol != SLT_V1_4) + if(sub_protocol>SLT_V2 && (i==CH2 || i==CH3) && sub_protocol != SLT_V1_4 && sub_protocol != RF_SIM) v=1023-v; // reverse throttle and elevator channels for Q100/Q200/MR100 protocols packet[i] = v; e = (e >> 2) | (uint8_t) ((v >> 2) & 0xC0); @@ -165,8 +165,13 @@ static void __attribute__((unused)) SLT_build_packet() |GET_FLAG(CH12_SW, FLAG_MR100_PICTURE); // Does not exist on the Q100 but... packet[7]=convert_channel_8b(CH7); packet[8]=convert_channel_8b(CH8); - packet[9]=0xAA; //normal mode for Q100/Q200, unknown for V2/MR100 - packet[10]=0x00; //normal mode for Q100/Q200, unknown for V2/MR100 + if(sub_protocol==RF_SIM) { + packet[9]=convert_channel_8b(CH9); + packet[10]=convert_channel_8b(CH10); + } else { + packet[9]=0xAA; //normal mode for Q100/Q200, unknown for V2/MR100 + packet[10]=0x00; //normal mode for Q100/Q200, unknown for V2/MR100 + } if((sub_protocol==Q100 || sub_protocol==Q200) && CH13_SW) {//Calibrate packet[9]=0x77; //enter calibration diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 03e8fef21..78e29ad0e 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -830,6 +830,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { Q100 Q200 MR100 + V1_4CH + RF_SIM PROTO_SYMAX SYMAX SYMAX5C diff --git a/Protocols_Details.md b/Protocols_Details.md index 2404692f8..8d3b5aa23 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -141,7 +141,7 @@ CFlie|38|CFlie||||||||NRF24L01| [SGF22](Protocols_Details.md#SGF22---97)|97|F22|F22S|J20||||||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|V1_4CH|||NRF24L01|CC2500 +[SLT](Protocols_Details.md#SLT---11)|11|SLT_V1|SLT_V2|Q100|Q200|MR100|V1_4CH|RF_SIM||NRF24L01|CC2500 [SymaX](Protocols_Details.md#Symax---10)|10|SYMAX|SYMAX5C|||||||NRF24L01| [Traxxas](Protocols_Details.md#Traxxas---43)|43|TQ1|TQ2|||||||CYRF6936| [V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|MR101||||||NRF24L01| @@ -1430,6 +1430,23 @@ CH1|CH2|CH3|CH4 ---|---|---|--- CH1|CH2|CH3|CH4 +### Sub_protocol RF_SIM - *6* +Models: the SLT-dongle included in RealFlight 7.5 + +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10 +---|---|---|---|---|---|---|---|---|---- +A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10 + +Output 10 channels to use with RealFlight simulator. +The RealFlight "reset" button found on the RealFlight USB-transmitter, can now be CH9 or CH10. + +RealFlight 8 crashes when trying to save file with reset-button defined. + +Please save radio-profile with a new name without setting reset-button in RF8. Then edit the radio-profile definition in ~\Documents\RealFlight8\RadioProfiles\ in an ordinary fileeditor. + +Find the [Reset21] section and change Input=INT:-1 to Input=INT:9 + + ## V911S - *46* CH1|CH2|CH3|CH4|CH5|CH6