From 4a470f8c4a85360148f835c471d08b5780529d67 Mon Sep 17 00:00:00 2001 From: Frankie Arzu <32604366+frankiearzu@users.noreply.github.com> Date: Sun, 7 Apr 2024 16:09:25 -0500 Subject: [PATCH] Changes required to run properly on 2.10 The way to find the switches worked in 2.9.4, but not in 2.10. Fixing it to a way that works for both. --- sdcard/c480x272/WIDGETS/SoarETX/1/f3k_sw.lua | 6 +++--- sdcard/c480x272/WIDGETS/SoarETX/1/f3kre_sw.lua | 6 +++--- sdcard/c480x272/WIDGETS/SoarETX/2/switch.lua | 11 ++++++----- sdcard/c480x320/WIDGETS/SoarETX/1/f3k_sw.lua | 6 +++--- sdcard/c480x320/WIDGETS/SoarETX/1/f3kre_sw.lua | 6 +++--- sdcard/c480x320/WIDGETS/SoarETX/2/switch.lua | 10 +++++----- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sdcard/c480x272/WIDGETS/SoarETX/1/f3k_sw.lua b/sdcard/c480x272/WIDGETS/SoarETX/1/f3k_sw.lua index 85b9069a..5e2afbee 100644 --- a/sdcard/c480x272/WIDGETS/SoarETX/1/f3k_sw.lua +++ b/sdcard/c480x272/WIDGETS/SoarETX/1/f3k_sw.lua @@ -92,9 +92,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName diff --git a/sdcard/c480x272/WIDGETS/SoarETX/1/f3kre_sw.lua b/sdcard/c480x272/WIDGETS/SoarETX/1/f3kre_sw.lua index 33d50a40..a62e2c2a 100644 --- a/sdcard/c480x272/WIDGETS/SoarETX/1/f3kre_sw.lua +++ b/sdcard/c480x272/WIDGETS/SoarETX/1/f3kre_sw.lua @@ -91,9 +91,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName diff --git a/sdcard/c480x272/WIDGETS/SoarETX/2/switch.lua b/sdcard/c480x272/WIDGETS/SoarETX/2/switch.lua index 33e32190..4bcc0524 100644 --- a/sdcard/c480x272/WIDGETS/SoarETX/2/switch.lua +++ b/sdcard/c480x272/WIDGETS/SoarETX/2/switch.lua @@ -2,8 +2,9 @@ -- SoarETX F3K switch setup, loadable component -- -- -- -- Author: Jesper Frickmann -- --- Date: 2022-02-14 -- --- Version: 1.0.0 -- +-- Improvements: Frankie Arzu -- +-- Date: 2024-04-7 -- +-- Version: 1.2.1 -- -- -- -- Copyright (C) EdgeTX -- -- -- @@ -133,9 +134,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName diff --git a/sdcard/c480x320/WIDGETS/SoarETX/1/f3k_sw.lua b/sdcard/c480x320/WIDGETS/SoarETX/1/f3k_sw.lua index 85b9069a..5e2afbee 100644 --- a/sdcard/c480x320/WIDGETS/SoarETX/1/f3k_sw.lua +++ b/sdcard/c480x320/WIDGETS/SoarETX/1/f3k_sw.lua @@ -92,9 +92,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName diff --git a/sdcard/c480x320/WIDGETS/SoarETX/1/f3kre_sw.lua b/sdcard/c480x320/WIDGETS/SoarETX/1/f3kre_sw.lua index 33d50a40..a62e2c2a 100644 --- a/sdcard/c480x320/WIDGETS/SoarETX/1/f3kre_sw.lua +++ b/sdcard/c480x320/WIDGETS/SoarETX/1/f3kre_sw.lua @@ -91,9 +91,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName diff --git a/sdcard/c480x320/WIDGETS/SoarETX/2/switch.lua b/sdcard/c480x320/WIDGETS/SoarETX/2/switch.lua index eeeb44c2..4bcc0524 100644 --- a/sdcard/c480x320/WIDGETS/SoarETX/2/switch.lua +++ b/sdcard/c480x320/WIDGETS/SoarETX/2/switch.lua @@ -3,8 +3,8 @@ -- -- -- Author: Jesper Frickmann -- -- Improvements: Frankie Arzu -- --- Date: 2024-01-15 -- --- Version: 1.2.0 -- +-- Date: 2024-04-7 -- +-- Version: 1.2.1 -- -- -- -- Copyright (C) EdgeTX -- -- -- @@ -134,9 +134,9 @@ local function init() -- Build lists of physical switch position indices and names local swIndices = { } local swNames = { } - local MAX_SW = getSwitchIndex(CHAR_TRIM .. "Rl") - 1 - for swIdx, swName in switches(-MAX_SW, MAX_SW) do - if swIdx ~= 0 then + + for swIdx, swName in switches() do + if string.find(swName,"^!?S[A-H][+-]?") then i = #swIndices + 1 swIndices[i] = swIdx swNames[i] = swName