From cd721e31d8e06b0716983f3e091da6c1b15a788f Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 23 Oct 2023 16:32:38 -0700 Subject: [PATCH 01/14] Allow zero and limit range of enterd values (#896) --- Lua_scripts/MultiConfig.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Lua_scripts/MultiConfig.lua b/Lua_scripts/MultiConfig.lua index 8709654..01042fe 100644 --- a/Lua_scripts/MultiConfig.lua +++ b/Lua_scripts/MultiConfig.lua @@ -135,10 +135,14 @@ local function Config_Draw_Edit( event ) Edit = 0 elseif event == EVT_VIRTUAL_PREV then -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 + if Menu_value[Edit_pos] > 0 then + Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 + end elseif event == EVT_VIRTUAL_NEXT then -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 + if Menu_value[Edit_pos] < 255 then + Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 + end end --Blink Blink = Blink + 1 @@ -319,9 +323,6 @@ local function Config_Draw_Menu() --Read line from buffer for i = 0, 20-1, 1 do value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end if value > 0x80 and Menu[line].field_type == 0 then -- Read field type Menu[line].field_type = bitand(value, 0xF0) @@ -334,6 +335,9 @@ local function Config_Draw_Menu() else if Menu[line].field_type == 0 then -- Text + if value == 0 then + break -- end of line + end Menu[line].text = Menu[line].text .. string.char(value) else -- Menu specific fields From 8d84386c7a709dc4bb8eff670dac9e4e5843a53a Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Mon, 30 Oct 2023 13:44:43 +0000 Subject: [PATCH 02/14] Fix LUA script zipping (#898) --- buildroot/bin/buildFunctions | 1 + buildroot/bin/build_release_extras | 15 +++++++++++++++ buildroot/bin/build_release_orx | 7 ------- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 buildroot/bin/build_release_extras diff --git a/buildroot/bin/buildFunctions b/buildroot/bin/buildFunctions index 7199533..d1a78dd 100644 --- a/buildroot/bin/buildFunctions +++ b/buildroot/bin/buildFunctions @@ -86,6 +86,7 @@ buildEachRFModule() { buildReleaseFiles(){ if [[ "$BOARD" =~ ":avr:multixmega32d4" ]]; then build_release_orx; + build_release_extras; elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=none" ]]; then build_release_avr_noboot; elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=optiboot" ]]; then diff --git a/buildroot/bin/build_release_extras b/buildroot/bin/build_release_extras new file mode 100644 index 0000000..17a6923 --- /dev/null +++ b/buildroot/bin/build_release_extras @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +source ./buildroot/bin/buildFunctions; +exitcode=0; + +printf "\e[33;1mPackaging ancilliary files for v$MULTI_VERSION\e[0m\n"; +cp Multiprotocol/Multi.txt ./binaries/Multi.txt; + +mkdir -p SCRIPTS/TOOLS; +cp -r Lua_scripts/* SCRIPTS/TOOLS/; +find SCRIPTS/TOOLS -type f -name "*.md" -delete + +zip -q -r ./binaries/MultiLuaScripts.zip SCRIPTS/TOOLS/*; + +exit $exitcode; diff --git a/buildroot/bin/build_release_orx b/buildroot/bin/build_release_orx index f2d05c4..c72f6fa 100644 --- a/buildroot/bin/build_release_orx +++ b/buildroot/bin/build_release_orx @@ -16,11 +16,4 @@ buildMulti; exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/mm-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin; -printf "\e[33;1mPackaging ancilliary files for v$MULTI_VERSION\e[0m\n"; -cp Multiprotocol/Multi.txt ./binaries/Multi.txt; -mkdir -p SCRIPTS/TOOLS; -cp Lua_scripts/*.lua SCRIPTS/TOOLS/; -cp Lua_scripts/*.txt SCRIPTS/TOOLS/; -zip -q ./binaries/MultiLuaScripts.zip SCRIPTS/TOOLS/*; - exit $exitcode; From 0bf94e96b5f5447dccca0f8cf5f8fe0aab453d3a Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 30 Oct 2023 22:36:09 +0100 Subject: [PATCH 03/14] E129/C186: New flip flag for C129V2 on CH11 --- Lua_scripts/MultiChan.txt | 2 +- Multiprotocol/E129_cyrf6936.ino | 5 +++-- Multiprotocol/Multiprotocol.h | 2 +- Protocols_Details.md | 8 +++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index 71550ca..c1e78ba 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -198,7 +198,7 @@ 81,0,E010r5,E010r5,1,Flip,LED,CALIB,HLess,RTH,GLIDE 82,0,LOLI,Std,0,CH5,CH6,CH7,CH8,1SwSePpPw,2SwSePw,3SwSe,4SwSe,5SwSeSb,6SwSe,7SwSePw,8SwSe 83,0,E129,E129,1,TakLan,EmStop,TrimA,TrimE,TrimR -83,1,E129,C186,1,TakLan,EmStop,TrimA,TrimE,TrimR,Loop +83,1,E129,C186,1,TakLan,EmStop,TrimA,TrimE,TrimR,Loop,Flip 84,0,JOYSWAY,Std,0 85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH 87,0,IKEA diff --git a/Multiprotocol/E129_cyrf6936.ino b/Multiprotocol/E129_cyrf6936.ino index 8366c27..0422d41 100644 --- a/Multiprotocol/E129_cyrf6936.ino +++ b/Multiprotocol/E129_cyrf6936.ino @@ -53,8 +53,9 @@ static void __attribute__((unused)) E129_build_data_packet() packet[15] = bit_reverse(rx_tx_addr[0]); packet[16] = bit_reverse(rx_tx_addr[1]); } - //packet[ 3] = 0x00; // E129 Mode: short press=0x20->0x00->0x20->..., long press=0x10->0x30->0x10->... => C186 throttle trim is doing the same:up=short press and down=long press - packet[ 3] = GET_FLAG(CH10_SW, 0x40); // C159 loop flight 0x40, flag 0x04 is also set on this heli + packet[ 3] = GET_FLAG(CH10_SW, 0x40) // C159 loop flight 0x40, flag 0x04 is also set on this heli + | GET_FLAG(CH11_SW, 0x08); // C129V2 flip + // Other flags in packet[3] => E129 Mode: short press=0x20->0x00->0x20->..., long press=0x10->0x30->0x10->... => C186 throttle trim is doing the same:up=short press and down=long press packet[ 4] = GET_FLAG(CH5_SW, 0x20) // Take off/Land 0x20 | GET_FLAG(CH6_SW, 0x04); // Emergency stop 0x04 //Channels and trims diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 281150b..89be1ee 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 34 +#define VERSION_PATCH_LEVEL 35 #define MODE_SERIAL 0 diff --git a/Protocols_Details.md b/Protocols_Details.md index a3eb6db..4a74af1 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -620,12 +620,14 @@ Models: C186/E120, C127/E110, K127, C159, C189 The FC of the heli seems to store the trims Trim A/E/R=CH7..9. If you use these trims, make sure to center them after powering off the heli or they will be added to the previous trims and over correct. -CH10| ----| -Loop| +CH10|CH11 +---|--- +Loop|Flip Loop: circular flight on the C159 (others?) +Flip: flip/aerobatic on the C129v2 (others?) + ## J6Pro - *22* CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12 From 2c9e98e34168e95be27f15b8141788c0d65bcc70 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 30 Oct 2023 22:48:04 +0100 Subject: [PATCH 04/14] 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 4a74af1..be33ab7 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -616,7 +616,7 @@ Calib is the same as the original radio with both sticks down and to the left in Models: Eachine E129/E130 and Twister Ninja 250 ### Sub_protocol C186 - *1* -Models: C186/E120, C127/E110, K127, C159, C189 +Models: C186/E120, C127/E110, K127, C159, C189, C129v2 The FC of the heli seems to store the trims Trim A/E/R=CH7..9. If you use these trims, make sure to center them after powering off the heli or they will be added to the previous trims and over correct. From a62d1dcd2e9db2b515bc646e7aa41596e7f5ff30 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 8 Nov 2023 10:53:57 +0100 Subject: [PATCH 05/14] Update Protocols_Details.md --- Protocols_Details.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index be33ab7..717da77 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -325,7 +325,9 @@ CH1|CH2|CH3|CH4 ## Kyosho - *73* ### Sub_protocol FHSS - *0* -Surface protocol called FHSS introduced in 2017. Transmitters: KT-531P, KT-431PT... +Surface protocol called FHSS introduced in 2017. Transmitter: KT-531P. Models: Mini-Z + +Extended limits supported CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14 ---|---|---|---|---|---|---|---|---|----|----|----|----|---- From 10ec4dd735ba30db35f99f36927b12531d431e3e Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 9 Nov 2023 11:57:26 +0100 Subject: [PATCH 06/14] Update Protocols_Details.md --- Protocols_Details.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Protocols_Details.md b/Protocols_Details.md index 717da77..954410e 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -1402,7 +1402,7 @@ If a CC2500 is installed it will be used for this sub protocol. Option in this c If only a NRF24L01 is installed then this sub protocol might be problematic because it is using the xn297L emulation with a transmission speed of 250kbps which doesn't work very well with every NRF24L01, this is an hardware issue with the authenticity and accuracy of the components. ### Sub_protocol X420 - *1* -Models: XK X420/X520 (TX=X4) +Models: XK X420/X520 (TX=X4), WLtoys 284131/284161/284010 *** # NRF24L01 RF Module @@ -1952,7 +1952,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11 A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS|MAG_CAL_X|MAG_CAL_Y ### Sub_protocol V2x2 - *0* -Models: WLToys V202/252/272, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 ... +Models: WLToys V202/252/272/A959/K969/K979/K989/K999, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 ... PICTURE: also automatic Missile Launcher and Hoist in one direction From ab5f75b1b3101ba97a6f4abfd2c3a11bc37320f6 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 9 Nov 2023 18:02:21 +0100 Subject: [PATCH 07/14] BlueFly: New protocol --- Multiprotocol/Bluefly_ccnrf.ino | 118 ++++++++++++++++++++++++++++++++ Multiprotocol/Multi.txt | 1 + Multiprotocol/Multi_Protos.ino | 4 ++ Multiprotocol/Multiprotocol.h | 4 +- Multiprotocol/Validate.h | 1 + Multiprotocol/_Config.h | 3 + Protocols_Details.md | 12 ++++ 7 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 Multiprotocol/Bluefly_ccnrf.ino diff --git a/Multiprotocol/Bluefly_ccnrf.ino b/Multiprotocol/Bluefly_ccnrf.ino new file mode 100644 index 0000000..cd97b73 --- /dev/null +++ b/Multiprotocol/Bluefly_ccnrf.ino @@ -0,0 +1,118 @@ +/* + 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 BLUEFLY HP100 + +#if defined(BLUEFLY_CCNRF_INO) + +#include "iface_nrf250k.h" + +#define BLUEFLY_PACKET_PERIOD 7000 +#define BLUEFLY_PACKET_SIZE 12 +#define BLUEFLY_RF_BIND_CHANNEL 81 +#define BLUEFLY_NUM_RF_CHANNELS 15 +#define BLUEFLY_BIND_COUNT 800 +#define BLUEFLY_TXID_SIZE 5 + +static void __attribute__((unused)) BLUEFLY_send_packet() +{ + if(IS_BIND_IN_PROGRESS) + { + memset(packet, 0x55, BLUEFLY_PACKET_SIZE); + memcpy(packet, rx_tx_addr, BLUEFLY_TXID_SIZE); + packet[5] = hopping_frequency[0]; + } + else + { + NRF250K_Hopping(hopping_frequency_no); + hopping_frequency_no++; + if(hopping_frequency_no >= BLUEFLY_NUM_RF_CHANNELS); + hopping_frequency_no = 0; + + packet[8] = packet[9] = 0; + for(uint8_t i=0; i<8 ; i++) + { + uint16_t ch = convert_channel_16b_limit(CH_AETR[i], 0, 1000); + packet[ i] = ch; + ch &= 0x300; + ch >>= 2; + packet[8 + (i>3?0:1)] = (packet[8 + (i>3?0:1)] >> 2) | ch; + } + uint8_t l, h, t; + l = h = 0xff; + for (uint8_t i=0; i<10; ++i) + { + h ^= packet[i]; + h ^= h >> 4; + t = h; + h = l; + l = t; + t = (l<<4) | (l>>4); + h ^= ((t<<2) | (t>>6)) & 0x1f; + h ^= t & 0xf0; + l ^= ((t<<1) | (t>>7)) & 0xe0; + } + // Checksum + packet[10] = h; + packet[11] = l; + } + + NRF250K_WritePayload(packet, BLUEFLY_PACKET_SIZE); + NRF250K_SetPower(); // Set tx_power + NRF250K_SetFreqOffset(); // Set frequency offset +} + +static void __attribute__((unused)) BLUEFLY_RF_init() +{ + NRF250K_Init(); + NRF250K_SetTXAddr((uint8_t *)"\x32\xAA\x45\x45\x78", 5); // BLUEFLY Bind address + NRF250K_HoppingCalib(BLUEFLY_NUM_RF_CHANNELS); // Calibrate all channels + NRF250K_RFChannel(BLUEFLY_RF_BIND_CHANNEL); // Set bind channel +} + +static void __attribute__((unused)) BLUEFLY_initialize_txid() +{ + uint8_t start = (rx_tx_addr[3] % 47) + 2; + for(uint8_t i=0;iNRF24L01, extension of MT99XX protocol PROTO_KYOSHO2 = 93, // =>NRF24L01 PROTO_SCORPIO = 94, // =>CYRF6936 + PROTO_BLUEFLY = 95, // =>CC2500 & NRF24L01 + PROTO_NANORF = 126, // =>NRF24L01 PROTO_TEST = 127, // =>CC2500 diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 3a20e35..8cc99e2 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -340,6 +340,7 @@ #undef ZSX_NRF24L01_INO #endif #if ( not defined(CC2500_INSTALLED) && not defined(NRF24L01_INSTALLED) ) || defined MULTI_EU + #undef BLUEFLY_CCNRF_INO #undef GD00X_CCNRF_INO #undef KF606_CCNRF_INO #undef MJXQ_CCNRF_INO diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index c18cbc4..bbf619f 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -255,6 +255,7 @@ #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 @@ -567,6 +568,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { QX100 PROTO_BAYANG_RX NONE + PROTO_BLUEFLY + NONE PROTO_BUGS NONE PROTO_BUGSMINI diff --git a/Protocols_Details.md b/Protocols_Details.md index 954410e..6b219a5 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -65,6 +65,7 @@ Protocol Name|Protocol Number|Sub_Proto 0|Sub_Proto 1|Sub_Proto 2|Sub_Proto 3|Su [Assan](Protocols_Details.md#ASSAN---24)|24|||||||||NRF24L01| [Bayang](Protocols_Details.md#BAYANG---14)|14|Bayang|H8S3D|X16_AH|IRDRONE|DHD_D4|QX100|||NRF24L01|XN297 [Bayang RX](Protocols_Details.md#BAYANG-RX---59)|59|Multi|CPPM|||||||NRF24L01|XN297 +[BlueFly](Protocols_Details.md#BLUEFLY---95)|95|||||||||NRF24L01| [Bugs](Protocols_Details.md#BUGS---41)|41|||||||||A7105| [BugsMini](Protocols_Details.md#BUGSMINI---42)|42|BUGSMINI|BUGS3H|||||||NRF24L01|XN297 [Cabell](Protocols_Details.md#Cabell---34)|34|Cabell_V3|C_TELEM|-|-|-|-|F_SAFE|UNBIND|NRF24L01| @@ -1034,6 +1035,17 @@ If a CC2500 is installed it will be used for all the below protocols. Option in If only a NRF24L01 is installed then these protocols might be problematic because they are using the XN297L emulation with a transmission speed of 250kbps which doesn't work very well with every NRF24L01, this is an hardware issue with the authenticity and accuracy of the components. +## BLUEFLY - *95* +Model: HP100 + +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8 +---|---|---|---|---|---|---|--- +A|E|T|R|CH5|CH6|CH7|CH8 + +TRIM: either use this channel for trim only or add a mixer with aileron to increase the roll rate. + +RATE: -100% high rate, +100% low rate + ## GD00X - *47* Model: GD005 C-17 Transport, GD006 DA62 and ZC-Z50 From 5ef944241a20a708b3bb50a2f88e4b8177035280 Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Fri, 10 Nov 2023 16:40:30 +0000 Subject: [PATCH 08/14] Add EU/LBT binaries to the build artifacts (#905) * Add release LBT builds * Use friendly build names * Script cleanup --- .github/workflows/main.yml | 30 +++++++---- buildroot/bin/build_release_stm32f1_64k | 22 ++++++++- buildroot/bin/build_release_stm32f1_no_debug | 52 +++++++++++++++++--- buildroot/bin/opt_remove | 5 ++ 4 files changed, 90 insertions(+), 19 deletions(-) create mode 100644 buildroot/bin/opt_remove diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b3577d..a9d6280 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,16 +39,26 @@ jobs: strategy: fail-fast: false matrix: - board: [ - "multi4in1:avr:multiatmega328p:bootloader=none", - "multi4in1:avr:multiatmega328p:bootloader=optiboot", - "multi4in1:avr:multixmega32d4", - "multi4in1:STM32F1:multi5in1t18int", - "multi4in1:STM32F1:multistm32f103cb:debug_option=none", - "multi4in1:STM32F1:multistm32f103cb:debug_option=native", - "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi", - "multi4in1:STM32F1:multistm32f103c8:debug_option=none" - ] + include: + - board: "multi4in1:avr:multiatmega328p:bootloader=none" + name: "ATmega328p" + - board: "multi4in1:avr:multiatmega328p:bootloader=optiboot" + name: "ATmega328p (Optiboot)" + - board: "multi4in1:avr:multixmega32d4" + name: "OrangeRX" + - board: "multi4in1:STM32F1:multistm32f103c8:debug_option=none" + name: "STM32F103 (64KB)" + - board: "multi4in1:STM32F1:multistm32f103cb:debug_option=none" + name: "STM32F103 (128KB)" + - board: "multi4in1:STM32F1:multistm32f103cb:debug_option=native" + name: "STM32F103 (128KB, USB Debugging)" + - board: "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi" + name: "STM32F103 (128KB, Serial Debugging)" + - board: "multi4in1:STM32F1:multi5in1t18int" + name: "T18 5-in-1 (128KB)" + + # Set the build name using the friendly board name + name: ${{ matrix.name }} # Set the environment variables env: diff --git a/buildroot/bin/build_release_stm32f1_64k b/buildroot/bin/build_release_stm32f1_64k index a626582..5cc7f3f 100644 --- a/buildroot/bin/build_release_stm32f1_64k +++ b/buildroot/bin/build_release_stm32f1_64k @@ -3,7 +3,7 @@ source ./buildroot/bin/buildFunctions; exitcode=0; -# CC2500-only 64Kb builds +# CC2500-only 64Kb FCC builds printf "\e[33;1mBuilding mm-stm-cc2500-64-aetr-v$MULTI_VERSION.bin\e[0m\n"; opt_enable $ALL_PROTOCOLS; opt_disable IKEAANSLUTA_CC2500_INO; @@ -28,4 +28,24 @@ buildMulti; exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-64-reta-v$MULTI_VERSION.bin; +# CC2500-only 64Kb LBT/EU builds +printf "\e[33;1mBuilding mm-stm-cc2500-64-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace RETA AETR; +opt_add MULTI_EU; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-64-aetr-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-cc2500-64-taer-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace AETR TAER; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-64-taer-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-cc2500-64-reta-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace TAER RETA; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-64-reta-lbt-v$MULTI_VERSION.bin; + exit $exitcode; diff --git a/buildroot/bin/build_release_stm32f1_no_debug b/buildroot/bin/build_release_stm32f1_no_debug index 42783b9..43a1744 100644 --- a/buildroot/bin/build_release_stm32f1_no_debug +++ b/buildroot/bin/build_release_stm32f1_no_debug @@ -3,11 +3,7 @@ source ./buildroot/bin/buildFunctions; exitcode=0; -# Builds for the DIY 5-in-1 module exceed the 120KB working capacity of the STM32F103CB -# To work around this we have to disable some protocols in the builds for this module -#DIY_5IN1_DISABLED="MOULDKG_NRF24L01_INO"; - -# Generic 4-in-1 builds +# Generic 4-in-1 FCC builds printf "\e[33;1mBuilding mm-stm-serial-aetr-v$MULTI_VERSION.bin\e[0m\n"; opt_disable ENABLE_PPM; buildMulti; @@ -26,10 +22,30 @@ buildMulti; exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-v$MULTI_VERSION.bin; +# Generic 4-in-1 LBT/EU builds +printf "\e[33;1mBuilding mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace RETA AETR; +opt_add MULTI_EU; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-aetr-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace AETR TAER; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-taer-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace TAER RETA; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-serial-reta-lbt-v$MULTI_VERSION.bin; + # DIY 5-in-1 builds printf "\e[33;1mBuilding mm-stm-5in1-aetr-v$MULTI_VERSION.bin\e[0m\n"; +opt_remove MULTI_EU; opt_replace RETA AETR; -#opt_disable $DIY_5IN1_DISABLED; opt_enable SX1276_INSTALLED; buildMulti; exitcode=$((exitcode+$?)); @@ -52,7 +68,6 @@ printf "\e[33;1mBuilding mm-tlite5in1-aetr-v$MULTI_VERSION.bin\e[0m\n"; opt_replace RETA AETR; opt_disable INVERT_TELEMETRY; opt_disable SX1276_INSTALLED; -#opt_enable $DIY_5IN1_DISABLED; opt_enable "MULTI_5IN1_INTERNAL JP_TLite" buildMulti; exitcode=$((exitcode+$?)); @@ -70,7 +85,7 @@ buildMulti; exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/mm-tlite5in1-reta-v$MULTI_VERSION.bin; -# CC2500-only builds +# CC2500-only FCC builds printf "\e[33;1mBuilding mm-stm-cc2500-aetr-v$MULTI_VERSION.bin\e[0m\n"; opt_replace RETA AETR; opt_disable "MULTI_5IN1_INTERNAL JP_TLite" @@ -94,11 +109,32 @@ buildMulti; exitcode=$((exitcode+$?)); mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-v$MULTI_VERSION.bin; +# CC2500-only LBT/EU builds +printf "\e[33;1mBuilding mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace RETA AETR; +opt_add MULTI_EU; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-aetr-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace AETR TAER; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-taer-lbt-v$MULTI_VERSION.bin; + +printf "\e[33;1mBuilding mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin\e[0m\n"; +opt_replace TAER RETA; +buildMulti; +exitcode=$((exitcode+$?)); +mv build/Multiprotocol.ino.bin ./binaries/mm-stm-cc2500-reta-lbt-v$MULTI_VERSION.bin; + # 4-in-1 PPM builds printf "\e[33;1mBuilding mm-stm-ppm-aetr-v$MULTI_VERSION.bin\e[0m\n"; opt_enable A7105_INSTALLED; opt_enable CYRF6936_INSTALLED; opt_enable NRF24L01_INSTALLED; +opt_remove MULTI_EU; opt_enable ENABLE_PPM; opt_disable ENABLE_SERIAL; opt_replace RETA AETR; diff --git a/buildroot/bin/opt_remove b/buildroot/bin/opt_remove new file mode 100644 index 0000000..022c1b1 --- /dev/null +++ b/buildroot/bin/opt_remove @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +SED=$(which gsed || which sed) + +eval "${SED} -i '/#define \b${1}/d' Multiprotocol/_Config.h" From ffcfd44127e51f42a115a78a204ad10697acc2a4 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sat, 11 Nov 2023 01:57:45 +0100 Subject: [PATCH 09/14] Bluefly fix? --- Multiprotocol/Bluefly_ccnrf.ino | 12 ++++++------ Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Multiprotocol/Bluefly_ccnrf.ino b/Multiprotocol/Bluefly_ccnrf.ino index cd97b73..19d64b1 100644 --- a/Multiprotocol/Bluefly_ccnrf.ino +++ b/Multiprotocol/Bluefly_ccnrf.ino @@ -18,7 +18,7 @@ #include "iface_nrf250k.h" -#define BLUEFLY_PACKET_PERIOD 7000 +#define BLUEFLY_PACKET_PERIOD 6000 #define BLUEFLY_PACKET_SIZE 12 #define BLUEFLY_RF_BIND_CHANNEL 81 #define BLUEFLY_NUM_RF_CHANNELS 15 @@ -49,6 +49,7 @@ static void __attribute__((unused)) BLUEFLY_send_packet() ch >>= 2; packet[8 + (i>3?0:1)] = (packet[8 + (i>3?0:1)] >> 2) | ch; } + // Checksum uint8_t l, h, t; l = h = 0xff; for (uint8_t i=0; i<10; ++i) @@ -63,7 +64,6 @@ static void __attribute__((unused)) BLUEFLY_send_packet() h ^= t & 0xf0; l ^= ((t<<1) | (t>>7)) & 0xe0; } - // Checksum packet[10] = h; packet[11] = l; } @@ -76,9 +76,9 @@ static void __attribute__((unused)) BLUEFLY_send_packet() static void __attribute__((unused)) BLUEFLY_RF_init() { NRF250K_Init(); - NRF250K_SetTXAddr((uint8_t *)"\x32\xAA\x45\x45\x78", 5); // BLUEFLY Bind address - NRF250K_HoppingCalib(BLUEFLY_NUM_RF_CHANNELS); // Calibrate all channels - NRF250K_RFChannel(BLUEFLY_RF_BIND_CHANNEL); // Set bind channel + NRF250K_SetTXAddr((uint8_t *)"\x32\xAA\x45\x45\x78", BLUEFLY_TXID_SIZE); // BLUEFLY Bind address + NRF250K_HoppingCalib(BLUEFLY_NUM_RF_CHANNELS); // Calibrate all channels + NRF250K_RFChannel(BLUEFLY_RF_BIND_CHANNEL); // Set bind channel } static void __attribute__((unused)) BLUEFLY_initialize_txid() @@ -100,7 +100,7 @@ uint16_t BLUEFLY_callback() if (bind_counter == 0) { BIND_DONE; - NRF250K_SetTXAddr(rx_tx_addr, 5); + NRF250K_SetTXAddr(rx_tx_addr, BLUEFLY_TXID_SIZE); } } BLUEFLY_send_packet(); diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 567bd8b..19d0700 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 36 +#define VERSION_PATCH_LEVEL 37 #define MODE_SERIAL 0 From f3331ca397fef54a296e0b4df8713bef89b2491b Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sat, 11 Nov 2023 11:48:54 +0100 Subject: [PATCH 10/14] Add pointer to Frank DSM Tools page --- Lua_scripts/README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Lua_scripts/README.md b/Lua_scripts/README.md index 2ad4ee7..e525d89 100644 --- a/Lua_scripts/README.md +++ b/Lua_scripts/README.md @@ -58,15 +58,11 @@ This is the Graupner HoTT adapted version of the Model Locator script using RSSI The OpenTX sensor "RSSI" is populated by the individual OpenTX telemetry protocol implementations and returns a value from 0..100 (percent) originating from the early FrSky implementation. It turns out that FrSky did not really provide a genuine signal strength indicator in units of dbm but a link quality indicator in 0..100%. With Graupner HoTT the link quality indicator is not a good basis for the model locator as it is very non-linear and doesn't change much with distance. Using the Graupner HoTT telemetry sensor "Rssi" which is a true signal strength indicator serves the purpose of locating a model much better as it varies much more with distance. -## DSM Forward Programming +## DSM Tools for EdgeTX and OpenTx -This is a work in progress. It's available for color(+touch) and B&W screens. +collection of EdgeTx/OpenTX Tools to use with Spektrum Receivers. Located on the radio SD card under \SCRIPTS\TOOLS, make sure to copy the DSMLIB folder! -Work on OpenTX and EdgeTX. Located on the radio SD card under \SCRIPTS\TOOLS, make sure to copy the DSMLIB folder along with DSM FwdPrg_05_Color.lua or DSM FwdPrg_05_BW.lua. - -[![DSM Forward Programming](https://img.youtube.com/vi/sjIaDw5j9nE/0.jpg)](https://www.youtube.com/watch?v=sjIaDw5j9nE) - -If some text appears as Unknown_xxx, please report xxx and what the exact text display should be. +Frank is maintaining these awesome tools, check out his [repository](https://github.com/frankiearzu/DSMTools). Feel free to ask questions or open issues there. ## DSM PID Flight log gain parameters for Blade micros From 5ae052317d49089b6934a9ea12f0db5b4bd2395a Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sat, 11 Nov 2023 11:50:17 +0100 Subject: [PATCH 11/14] Update README.md --- Lua_scripts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lua_scripts/README.md b/Lua_scripts/README.md index e525d89..1bc6204 100644 --- a/Lua_scripts/README.md +++ b/Lua_scripts/README.md @@ -60,7 +60,7 @@ The OpenTX sensor "RSSI" is populated by the individual OpenTX telemetry protoco ## DSM Tools for EdgeTX and OpenTx -collection of EdgeTx/OpenTX Tools to use with Spektrum Receivers. Located on the radio SD card under \SCRIPTS\TOOLS, make sure to copy the DSMLIB folder! +Collection of EdgeTx/OpenTX Tools to use with Spektrum Receivers including forward programming. Located on the radio SD card under \SCRIPTS\TOOLS, make sure to copy the DSMLIB folder! Frank is maintaining these awesome tools, check out his [repository](https://github.com/frankiearzu/DSMTools). Feel free to ask questions or open issues there. From 62ecaa84127f4421a01ba5ec02b87a13abb23af2 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 22 Nov 2023 07:57:30 +0100 Subject: [PATCH 12/14] Revert J6Pro changes --- Multiprotocol/J6Pro_cyrf6936.ino | 6 ++++-- Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Multiprotocol/J6Pro_cyrf6936.ino b/Multiprotocol/J6Pro_cyrf6936.ino index 195e266..fd58051 100644 --- a/Multiprotocol/J6Pro_cyrf6936.ino +++ b/Multiprotocol/J6Pro_cyrf6936.ino @@ -36,7 +36,7 @@ enum PktState { }; const uint8_t PROGMEM j6pro_bind_sop_code[] = {0x62, 0xdf, 0xc1, 0x49, 0xdf, 0xb1, 0xc0, 0x49}; -//const uint8_t j6pro_data_code[] = {0x02, 0xf9, 0x93, 0x97, 0x02, 0xfa, 0x5c, 0xe3, 0x01, 0x2b, 0xf1, 0xdb, 0x01, 0x32, 0xbe, 0x6f}; // unneeded since this is the default table after a reset +const uint8_t j6pro_data_code[] = {0x02, 0xf9, 0x93, 0x97, 0x02, 0xfa, 0x5c, 0xe3, 0x01, 0x2b, 0xf1, 0xdb, 0x01, 0x32, 0xbe, 0x6f}; // unneeded since this is the default table after a reset static void __attribute__((unused)) j6pro_build_bind_packet() { @@ -84,7 +84,9 @@ static void __attribute__((unused)) j6pro_cyrf_init() CYRF_WriteRegister(CYRF_10_FRAMING_CFG, 0xee); CYRF_WriteRegister(CYRF_1F_TX_OVERRIDE, 0x00); CYRF_WriteRegister(CYRF_1E_RX_OVERRIDE, 0x00); - //CYRF_ConfigDataCode(j6pro_data_code, 16); + + //Same as default reset but issues if not configured... + CYRF_ConfigDataCode(j6pro_data_code, 16); CYRF_WritePreamble(0x333302); CYRF_GetMfgData(cyrfmfg_id); diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 19d0700..c34b173 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 37 +#define VERSION_PATCH_LEVEL 38 #define MODE_SERIAL 0 From 7e7b55580943e6013b0901e14db3c47d7c22b9d3 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 22 Nov 2023 07:57:54 +0100 Subject: [PATCH 13/14] LOSI: dynamic channel --- Multiprotocol/Losi_cyrf6936.ino | 34 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/Multiprotocol/Losi_cyrf6936.ino b/Multiprotocol/Losi_cyrf6936.ino index 114b09f..7a13566 100644 --- a/Multiprotocol/Losi_cyrf6936.ino +++ b/Multiprotocol/Losi_cyrf6936.ino @@ -19,7 +19,7 @@ #define LOSI_FORCE_ID -const uint8_t PROGMEM LOSI_bind_sop_code[] = {0x62, 0xdf, 0xc1, 0x49, 0xdf, 0xb1, 0xc0, 0x49}; +//const uint8_t PROGMEM LOSI_bind_sop_code[] = {0x62, 0xdf, 0xc1, 0x49, 0xdf, 0xb1, 0xc0, 0x49}; const uint8_t LOSI_data_code[][16] = { { 0xD7, 0xA1, 0x54, 0xB1, 0x5E, 0x89, 0xAE, 0x86, 0xC9, 0x2C, 0x06, 0x93, 0x86, 0xB9, 0x9E, 0xD7 }, //bind /* { 0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40, 0x93, 0xDC, 0x68, 0x08, 0x99, 0x97, 0xAE, 0xAF, 0x8C }, @@ -34,12 +34,12 @@ const uint8_t LOSI_data_code[][16] = { static uint16_t __attribute__((unused)) LOSI_check(uint16_t val) { - const uint8_t PROGMEM tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 }; + uint8_t tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 }; uint8_t res = 0x0B, tmp; uint16_t calc = val>>2; // don't care about the 2 first bits for(uint8_t i=0; i<5; i++) { - tmp=pgm_read_byte_near(&tab[i&0x03]); + tmp=tab[i&0x03]; if(calc&0x0001) res ^= tmp>>4; calc >>= 1; @@ -94,17 +94,17 @@ static void __attribute__((unused)) LOSI_cyrf_init() CYRF_WritePreamble(0x333304); //CYRF_WriteRegister(CYRF_27_CLK_OVERRIDE, 0x00); CYRF_WriteRegister(CYRF_10_FRAMING_CFG, 0x4A); - CYRF_WriteRegister(CYRF_1F_TX_OVERRIDE, 0x04); // No CRC + CYRF_WriteRegister(CYRF_1F_TX_OVERRIDE, 0x04); // No CRC //CYRF_WriteRegister(CYRF_1E_RX_OVERRIDE, 0x14); //CYRF_WriteRegister(CYRF_14_EOP_CTRL, 0x02); + CYRF_ConfigDataCode(LOSI_data_code[0], 16); // Load bind data code } uint16_t LOSI_callback() { #ifdef MULTI_SYNC - telemetry_set_input_sync(19738); + telemetry_set_input_sync(packet_period); #endif - LOSI_send_packet(); if(bind_counter) { bind_counter--; @@ -112,17 +112,16 @@ uint16_t LOSI_callback() { BIND_DONE; CYRF_ConfigDataCode(LOSI_data_code[1], 16); // Load normal data code + packet_period = 19738; } - return 8763; } - return 19738; + LOSI_send_packet(); + return packet_period; } void LOSI_init() { LOSI_cyrf_init(); - //CYRF_FindBestChannels(hopping_frequency, 1, 0, 0x13, 75); // 75 is unknown since dump stops at 0x27, this routine resets the CRC Seed to 0 - //CYRF_ConfigRFChannel(hopping_frequency[0] | 1); // Only odd channels #ifdef LOSI_FORCE_ID rx_tx_addr[0] = 0x47; @@ -132,16 +131,11 @@ void LOSI_init() CYRF_ConfigRFChannel(0x27); #endif - if(IS_BIND_IN_PROGRESS) - { - bind_counter = 300; - CYRF_ConfigDataCode(LOSI_data_code[0], 16); // Load bind data code - } - else - { - CYRF_ConfigDataCode(LOSI_data_code[1], 16); // Load normal data code - bind_counter = 0; - } + CYRF_FindBestChannels(hopping_frequency, 1, 0, 0x13, 75); // 75 is unknown since dump stops at 0x27, this routine resets the CRC Seed to 0 + CYRF_ConfigRFChannel(hopping_frequency[0]); // Only odd channels integrated in CYRF code... + + bind_counter = IS_BIND_IN_PROGRESS?300:1; + packet_period = 8763; } #endif From a682b0e6043a6e706794efd3fe555839475e6dcf Mon Sep 17 00:00:00 2001 From: pascallanger Date: Wed, 22 Nov 2023 08:26:03 +0100 Subject: [PATCH 14/14] Update Losi_cyrf6936.ino --- Multiprotocol/Losi_cyrf6936.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Losi_cyrf6936.ino b/Multiprotocol/Losi_cyrf6936.ino index 7a13566..a7414fa 100644 --- a/Multiprotocol/Losi_cyrf6936.ino +++ b/Multiprotocol/Losi_cyrf6936.ino @@ -34,12 +34,12 @@ const uint8_t LOSI_data_code[][16] = { static uint16_t __attribute__((unused)) LOSI_check(uint16_t val) { - uint8_t tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 }; + const uint8_t PROGMEM tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 }; uint8_t res = 0x0B, tmp; uint16_t calc = val>>2; // don't care about the 2 first bits for(uint8_t i=0; i<5; i++) { - tmp=tab[i&0x03]; + tmp=pgm_read_byte_near(&tab[i&0x03]); if(calc&0x0001) res ^= tmp>>4; calc >>= 1;