Skip to content

Commit 54ffdbf

Browse files
committed
Suppressing sending of RSSI in background while in menu.
1 parent df9b933 commit 54ffdbf

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

bin/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
if [ -d obj ]; then
4-
rm -fR obj
4+
rm -fR obj/*
55
fi
66

7-
cp -fR src obj
7+
cp -fR src/* obj
88

99
MANIFEST=(`find obj/ -name *.lua -type f`);
1010

src/SCRIPTS/TELEMETRY/bf.lua

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ assert(loadScript(radio.preLoad))()
77
assert(loadScript(protocol.transport))()
88
assert(loadScript(SCRIPT_HOME.."/MSP/common.lua"))()
99

10-
local run = assert(loadScript(SCRIPT_HOME.."/ui.lua"))()
10+
local run_ui = assert(loadScript(SCRIPT_HOME.."/ui.lua"))()
11+
local background = assert(loadScript(SCRIPT_HOME.."/background.lua"))()
1112

12-
return { run=run }
13+
local MENU_TIMESLICE = 100
14+
15+
local lastMenuEvent = 0
16+
17+
function run(event)
18+
lastMenuEvent = getTime()
19+
20+
run_ui(event)
21+
end
22+
23+
function run_bg()
24+
if lastMenuEvent + MENU_TIMESLICE < getTime() then
25+
background.run_bg()
26+
end
27+
end
28+
29+
return { init=background.init, run=run, background=run_bg }

0 commit comments

Comments
 (0)