Skip to content

Telemetry script fixes after #254 #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/SCRIPTS/BF/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ function run_ui(event)
-- if lastRunTS old than 500ms
if lastRunTS + 50 < now then
invalidatePages()
if useMenu then
currentState = pageStatus.mainMenu
else
if isTelemetryScript then
currentState = pageStatus.display
else
currentState = pageStatus.mainMenu
end
end
lastRunTS = now
Expand Down Expand Up @@ -353,11 +353,11 @@ function run_ui(event)
currentState = pageStatus.editing
end
elseif event == EVT_VIRTUAL_EXIT then
if useMenu then
stopDisplay = true
else
if isTelemetryScript then
return protocol.exitFunc();
end
else
stopDisplay = true
end
end
-- editing value
elseif currentState == pageStatus.editing then
Expand Down Expand Up @@ -406,7 +406,7 @@ function run_ui(event)
lcd.drawText(SaveBox.x+SaveBox.x_offset,SaveBox.y+SaveBox.h_offset,"Retrying",DBLSIZE + (globalTextOptions))
end
end
if currentState == pageStatus.mainMenu and useMenu then
if currentState == pageStatus.mainMenu and (not isTelemetryScript) then
if event == EVT_VIRTUAL_EXIT then
return 2
elseif event == EVT_VIRTUAL_NEXT then
Expand Down Expand Up @@ -438,7 +438,7 @@ function run_ui(event)
end
end
end
if stopDisplay then
if stopDisplay and (not isTelemetryScript) then
currentState = pageStatus.mainMenu
stopDisplay = false
end
Expand Down
1 change: 0 additions & 1 deletion src/SCRIPTS/TELEMETRY/bf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ local lastMenuEvent = 0

function run(event)
lastMenuEvent = getTime()

run_ui(event)
end

Expand Down
2 changes: 1 addition & 1 deletion src/SCRIPTS/TOOLS/bf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local toolName = "TNS|Betaflight setup|TNE"
SCRIPT_HOME = "/SCRIPTS/BF"

apiVersion = 0
useMenu = true
isTelemetryScript = false

protocol = assert(loadScript(SCRIPT_HOME.."/protocols.lua"))()
radio = assert(loadScript(SCRIPT_HOME.."/radios.lua"))()
Expand Down