We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6676a11 commit e2597afCopy full SHA for e2597af
src/SCRIPTS/BF/MSP/common.lua
@@ -6,6 +6,7 @@ local MSP_STARTFLAG = bit32.lshift(1,4)
6
local mspSeq = 0
7
local mspRemoteSeq = 0
8
local mspRxBuf = {}
9
+local mspRxError = false
10
local mspRxSize = 0
11
local mspRxCRC = 0
12
local mspRxReq = 0
@@ -65,17 +66,13 @@ end
65
66
function mspReceivedReply(payload)
67
local idx = 1
68
local status = payload[idx]
- local err = bit32.btest(status, 0x80)
69
local version = bit32.rshift(bit32.band(status, 0x60), 5)
70
local start = bit32.btest(status, 0x10)
71
local seq = bit32.band(status, 0x0F)
72
idx = idx + 1
73
- if err then
74
- mspStarted = false
75
- return nil
76
- end
77
if start then
78
mspRxBuf = {}
+ mspRxError = bit32.btest(status, 0x80)
79
mspRxSize = payload[idx]
80
mspRxReq = mspLastReq
81
@@ -117,7 +114,7 @@ function mspPollReply()
117
114
return nil
118
115
elseif mspReceivedReply(mspData) then
119
116
mspLastReq = 0
120
- return mspRxReq, mspRxBuf
+ return mspRxReq, mspRxBuf, mspRxError
121
end
122
123
src/SCRIPTS/BF/PAGES/vtx.lua
@@ -12,8 +12,9 @@ local labels = {}
local fields = {}
13
14
local vtx_tables
15
-if apiVersion >= 1.42 then
16
- vtx_tables = assert(loadScript("VTX_TABLES/"..mcuId..".lua"))()
+local f = loadScript("VTX_TABLES/"..mcuId..".lua")
+if apiVersion >= 1.42 and f then
17
+ vtx_tables = f()
18
else
19
vtx_tables = assert(loadScript("VTX_TABLES/vtx_defaults.lua"))()
20
src/SCRIPTS/BF/acc_cal.lua
@@ -3,8 +3,8 @@ local accCalibrated = false
3
local lastRunTS = 0
4
local INTERVAL = 500
5
-local function processMspReply(cmd,rx_buf)
- if cmd == MSP_ACC_CALIBRATION then
+local function processMspReply(cmd,rx_buf,err)
+ if cmd == MSP_ACC_CALIBRATION andnoterrthen
accCalibrated = true
src/SCRIPTS/BF/api_version.lua
@@ -4,8 +4,8 @@ local apiVersionReceived = false
local INTERVAL = 50
- if cmd == MSP_API_VERSION and #rx_buf >= 3 then
+ if cmd == MSP_API_VERSION and #rx_buf >= 3 andnoterrthen
apiVersion = rx_buf[2] + rx_buf[3] / 100
apiVersionReceived = true
src/SCRIPTS/BF/board_info.lua
@@ -20,8 +20,8 @@ local i2cRegisteredDeviceCount = 0
21
local INTERVAL = 100
22
23
-local function processMspReply(cmd, payload)
24
- if cmd == MSP_BOARD_INFO then
+local function processMspReply(cmd, payload, err)
+ if cmd == MSP_BOARD_INFO andnoterrthen
25
local length
26
local i = 1
27
length = 4
src/SCRIPTS/BF/mcu_id.lua
@@ -5,8 +5,8 @@ local MCUIdReceived = false
- if cmd == MSP_UID then
+ if cmd == MSP_UID andnoterrthen
local id = ""
for j = 1, 3 do
src/SCRIPTS/BF/rssi.lua
@@ -9,8 +9,8 @@ local rssiSource = RSSI_SOURCE_NONE
- if cmd == MSP_TX_INFO and #rx_buf >= 1 then
+ if cmd == MSP_TX_INFO and #rx_buf >= 1 andnoterrthen
rssiSource = rx_buf[1]
rssiSourceReceived = true
src/SCRIPTS/BF/rtc.lua
@@ -4,8 +4,8 @@ local timeIsSet = false
- if cmd == MSP_SET_RTC then
+ if cmd == MSP_SET_RTC andnoterrthen
timeIsSet = true
src/SCRIPTS/BF/ui.lua
@@ -96,8 +96,8 @@ local function createPopupMenu()
96
97
98
99
100
- if not Page or not rx_buf then
+ if not Page or not rx_buf orerrthen
101
elseif cmd == Page.write then
102
if Page.eepromWrite then
103
eepromWrite()
src/SCRIPTS/BF/vtx_tables.lua
@@ -2,6 +2,7 @@ local MSP_VTX_CONFIG = 88
2
local MSP_VTXTABLE_BAND = 137
local MSP_VTXTABLE_POWERLEVEL = 138
+local vtxAvailable = true
local vtxTableAvailable = false
local vtxConfigReceived = false
local vtxFrequencyTableReceived = false
@@ -18,8 +19,12 @@ local powerTable = {}
if cmd == MSP_VTX_CONFIG then
+ if err then
+ vtxAvailable = false
+ return
+ end
28
vtxConfigReceived = true
29
vtxTableAvailable = payload[12] ~= 0
30
vtxTableConfig.bands = payload[13]
@@ -113,7 +118,7 @@ local function getVtxTables()
113
mspProcessTxQ()
processMspReply(mspPollReply())
- return vtxTablesReceived
+ return vtxTablesReceivedornotvtxAvailable
124
return { f = getVtxTables, t = "Downloading VTX tables" }
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments