Skip to content

Commit a5a8706

Browse files
fixes issue with scrambled values when fast cycling through the pages
1 parent 4a6b28a commit a5a8706

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SCRIPTS/BF/MSP/common.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local mspRemoteSeq = 0
99
local mspRxBuf = {}
1010
local mspRxIdx = 1
1111
local mspRxCRC = 0
12+
local mspRxReq = 0
1213
local mspStarted = false
1314
local mspLastReq = 0
1415
local mspTxBuf = {}
@@ -96,6 +97,7 @@ function mspReceivedReply(payload)
9697
mspRxBuf = {}
9798
mspRxSize = payload[idx]
9899
mspRxCRC = bit32.bxor(mspRxSize,mspLastReq)
100+
mspRxReq = mspLastReq
99101
idx = idx + 1
100102
mspStarted = true
101103
elseif not mspStarted then
@@ -129,7 +131,7 @@ function mspPollReply()
129131
while true do
130132
ret = protocol.mspPoll()
131133
if type(ret) == "table" then
132-
return mspLastReq, ret
134+
return mspRxReq, ret
133135
else
134136
break
135137
end

0 commit comments

Comments
 (0)