1
1
local apiVersionReceived = false
2
- local vtxTablesReceived = false
3
2
local mcuIdReceived = false
4
3
local boardInfoReceived = false
5
- local getApiVersion , getVtxTables , getMCUId , getBoardInfo
4
+ local featuresReceived = false
5
+ local getApiVersion , getMCUId , getBoardInfo , getFeaturesInfo
6
6
local returnTable = { f = nil , t = " " }
7
7
8
8
local function init ()
@@ -22,30 +22,6 @@ local function init()
22
22
mcuIdReceived = getMCUId .f ()
23
23
if mcuIdReceived then
24
24
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
49
25
collectgarbage ()
50
26
end
51
27
elseif not boardInfoReceived and apiVersion >= 1.44 then
@@ -56,10 +32,18 @@ local function init()
56
32
getBoardInfo = nil
57
33
collectgarbage ()
58
34
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
59
43
else
60
44
return true
61
45
end
62
- return apiVersionReceived and vtxTablesReceived and mcuId and boardInfoReceived
46
+ return apiVersionReceived and vtxTablesReceived and mcuId and boardInfoReceived and featuresReceived
63
47
end
64
48
65
49
returnTable .f = init
0 commit comments