11local apiVersionReceived = false
2- local vtxTablesReceived = false
32local mcuIdReceived = false
43local boardInfoReceived = false
5- local getApiVersion , getVtxTables , getMCUId , getBoardInfo
4+ local featuresReceived = false
5+ local getApiVersion , getMCUId , getBoardInfo , getFeaturesInfo
66local returnTable = { f = nil , t = " " }
77
88local function init ()
@@ -22,30 +22,6 @@ local function init()
2222 mcuIdReceived = getMCUId .f ()
2323 if mcuIdReceived then
2424 getMCUId = nil
25- local f = loadScript (" VTX_TABLES/" .. mcuId .. " .lua" )
26- if f then
27- local table = f ()
28- if table then
29- vtxTablesReceived = true
30- features .vtx = 0 < table .frequenciesPerBand
31- f = nil
32- table = nil
33- end
34- end
35- collectgarbage ()
36- f = loadScript (" BOARD_INFO/" .. mcuId .. " .lua" )
37- if f and f () then
38- boardInfoReceived = true
39- f = nil
40- end
41- collectgarbage ()
42- end
43- elseif not vtxTablesReceived and apiVersion >= 1.42 then
44- getVtxTables = getVtxTables or assert (loadScript (" vtx_tables.lua" ))()
45- returnTable .t = getVtxTables .t
46- vtxTablesReceived = getVtxTables .f ()
47- if vtxTablesReceived then
48- getVtxTables = nil
4925 collectgarbage ()
5026 end
5127 elseif not boardInfoReceived and apiVersion >= 1.44 then
@@ -56,10 +32,18 @@ local function init()
5632 getBoardInfo = nil
5733 collectgarbage ()
5834 end
35+ elseif not featuresReceived and apiVersion >= 1.41 then
36+ getFeaturesInfo = getFeaturesInfo or assert (loadScript (" features_info.lua" ))()
37+ returnTable .t = getFeaturesInfo .t
38+ featuresReceived = getFeaturesInfo .f ()
39+ if featuresReceived then
40+ getFeaturesInfo = nil
41+ collectgarbage ()
42+ end
5943 else
6044 return true
6145 end
62- return apiVersionReceived and vtxTablesReceived and mcuId and boardInfoReceived
46+ return apiVersionReceived and vtxTablesReceived and mcuId and boardInfoReceived and featuresReceived
6347end
6448
6549returnTable .f = init
0 commit comments