mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-12-06 07:37:38 +00:00
FrSkyA Lua: no table library (B&W radios) (#1218)
EdgeTX has the Lua table library on color radios only: table.remove() in sendQueue() stopped the script on a TX12 MkII at its first run (shown as "syntax error"). The queue is shifted by hand. Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
1 parent
aa916c2852
commit
4198c434b5
1 file changed
+5
-1
@@ -130,7 +130,11 @@ end
|
|||||||
|
|
||||||
local function sendQueue()
|
local function sendQueue()
|
||||||
if #queue == 0 or multiBuffer(TX_READY) ~= 0 then return end
|
if #queue == 0 or multiBuffer(TX_READY) ~= 0 then return end
|
||||||
local piece = table.remove(queue, 1)
|
local piece = queue[1]
|
||||||
|
for i = 1, #queue - 1 do -- no table library on B&W radios
|
||||||
|
queue[i] = queue[i + 1]
|
||||||
|
end
|
||||||
|
queue[#queue] = nil
|
||||||
for i = 1, TX_MAX_PAYLOAD do
|
for i = 1, TX_MAX_PAYLOAD do
|
||||||
multiBuffer(TX_PAYLOAD + i - 1, piece[i] or 0)
|
multiBuffer(TX_PAYLOAD + i - 1, piece[i] or 0)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user