This repository was archived by the owner on Nov 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,25 @@ local CRSF_FRAMETYPE_MSP_WRITE = 0x7C -- write with 60 byte chunked
99
1010local crsfMspCmd = 0
1111
12+
13+ local crsfPopFrame
14+ local crsfPushFrame
15+
16+ if crsf .getSensor ~= nil then
17+ local sensor = crsf .getSensor ()
18+ crsfPopFrame = function () return sensor :popFrame () end
19+ crsfPushFrame = function (x ,y ) return sensor :pushFrame (x ,y ) end
20+ else
21+ crsfPopFrame = function () return crsf .popFrame () end
22+ crsfPushFrame = function (x ,y ) return crsf .pushFrame (x ,y ) end
23+ end
24+
1225bf .protocol .mspSend = function (payload )
1326 local payloadOut = { CRSF_ADDRESS_BETAFLIGHT , CRSF_ADDRESS_RADIO_TRANSMITTER }
1427 for i = 1 , # (payload ) do
1528 payloadOut [i + 2 ] = payload [i ]
1629 end
17- return crsf . pushFrame (crsfMspCmd , payloadOut )
30+ return crsfPushFrame (crsfMspCmd , payloadOut )
1831end
1932
2033bf .protocol .mspRead = function (cmd )
2942
3043bf .protocol .mspPoll = function ()
3144 while true do
32- local cmd , data = crsf . popFrame ()
45+ local cmd , data = crsfPopFrame ()
3346 if cmd == CRSF_FRAMETYPE_MSP_RESP and data [1 ] == CRSF_ADDRESS_RADIO_TRANSMITTER and data [2 ] == CRSF_ADDRESS_BETAFLIGHT then
3447--[[
3548 bf.print("cmd:0x"..string.format("%X", cmd))
You can’t perform that action at this time.
0 commit comments