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.
2 parents 6676a11 + 61d3029 commit d900131Copy full SHA for d900131
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/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
20
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
13
- if cmd == MSP_TX_INFO and #rx_buf >= 1 then
+ if cmd == MSP_TX_INFO and #rx_buf >= 1 andnoterrthen
14
rssiSource = rx_buf[1]
15
rssiSourceReceived = true
16
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,7 +96,7 @@ local function createPopupMenu()
96
97
98
99
100
if not Page or not rx_buf then
101
elseif cmd == Page.write then
102
if Page.eepromWrite then
@@ -109,6 +109,9 @@ local function processMspReply(cmd,rx_buf)
109
rebootFc()
110
111
invalidatePages()
112
+ elseif cmd == Page.read and err then
113
+ Page.fields = { { x = 6, y = radio.yMinLimit, value = "", ro = true } }
+ Page.labels = { { x = 6, y = radio.yMinLimit, t = "N/A" } }
elseif cmd == Page.read and #rx_buf > 0 then
Page.values = rx_buf
for i=1,#Page.fields do
src/SCRIPTS/BF/vtx_tables.lua
@@ -11,15 +11,26 @@ local requestedBand = 1
local requestedPowerLevel = 1
local vtxTableConfig = {}
local frequencyTable = {}
-local frequenciesPerBand = 0
local bandTable = {}
local powerTable = {}
17
18
19
if cmd == MSP_VTX_CONFIG then
+ if err then
+ -- Vtx not available. Create empty vtx table to skip future download attempts
+ frequencyTable[1] = {}
+ vtxTableConfig.channels = 0
+ bandTable = { [0] = "U", "1" }
+ powerTable = { "LV0" }
28
+ vtxConfigReceived = true
29
+ vtxTableAvailable = true
30
+ vtxFrequencyTableReceived = true
31
+ vtxPowerTableReceived = true
32
+ return
33
+ end
34
vtxConfigReceived = true
35
vtxTableAvailable = payload[12] ~= 0
36
vtxTableConfig.bands = payload[13]
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments