Skip to content

Commit

Permalink
Merge pull request #5 from teckel12/development
Browse files Browse the repository at this point in the history
collectgarbage() moved around a bit
  • Loading branch information
teckel12 authored Aug 22, 2018
2 parents 41a7d42 + 1438cb7 commit e13848f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SCRIPTS/TELEMETRY/VTx.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SCRIPT_HOME = "/SCRIPTS/TELEMETRY/VTx"

LOCAL_SENSOR_ID = 0x0D
SMARTPORT_REMOTE_SENSOR_ID = 0x1B
FPORT_REMOTE_SENSOR_ID = 0x00
Expand Down Expand Up @@ -60,23 +61,24 @@ assert(loadScript(SCRIPT_HOME.."/common.luac", "T"))()
collectgarbage()

local run_ui = assert(loadScript(SCRIPT_HOME.."/ui.luac", "T"))()
collectgarbage()

local background = assert(loadScript(SCRIPT_HOME.."/background.luac", "T"))()
collectgarbage()

local MENU_TIMESLICE = 100

local lastMenuEvent = 0

function run(event)
lastMenuEvent = getTime()

collectgarbage()
run_ui(event)
end

function run_bg()
collectgarbage()
if lastMenuEvent + MENU_TIMESLICE < getTime() then
background.run_bg()
collectgarbage()
end
end

Expand Down
Binary file modified SCRIPTS/TELEMETRY/VTx.luac
Binary file not shown.

0 comments on commit e13848f

Please sign in to comment.