-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from atomgomba/skip-board-info-if-possible
Download board info only if necessary
- Loading branch information
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local template = assert(loadScript(radio.template))() | ||
local margin = template.margin | ||
local lineSpacing = template.lineSpacing | ||
local yMinLim = radio.yMinLimit | ||
local x = margin | ||
local y = yMinLim - lineSpacing | ||
local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } | ||
local labels = {} | ||
local fields = {} | ||
|
||
labels[#labels + 1] = { t = "Download Board Info? Press", x = x, y = inc.y(lineSpacing) } | ||
labels[#labels + 1] = { t = "[ENTER] to download, or", x = x, y = inc.y(lineSpacing) } | ||
labels[#labels + 1] = { t = "[EXIT] to cancel.", x = x, y = inc.y(lineSpacing) } | ||
fields[#fields + 1] = { x = x, y = inc.y(lineSpacing), value = "", ro = true } | ||
|
||
return { | ||
title = "Board Info", | ||
labels = labels, | ||
fields = fields, | ||
init = assert(loadScript("board_info.lua"))(), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local function precondition() | ||
if apiVersion < 1.44 then | ||
-- BOARD_INFO is unavailable below 1.44 | ||
return nil | ||
end | ||
local hasBoardInfo = loadScript("BOARD_INFO/"..mcuId..".lua") | ||
collectgarbage() | ||
if hasBoardInfo then | ||
return nil | ||
else | ||
return "CONFIRM/pwm.lua" | ||
end | ||
end | ||
|
||
return precondition() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters