Skip to content

Commit f022976

Browse files
authored
Merge pull request #203 from mikeller/fix_nil_error
Fixed error if API version not received.
2 parents 8d9aeb4 + e0746ee commit f022976

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/SCRIPTS/BF/X9/rescue.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ return {
66
eepromWrite = true,
77
minBytes = 16,
88
requiredVersion = 1.041,
9-
10-
119
text = {
1210
{ t = "Min Sats.", x = 30, y = 16, to = SMLSIZE },
1311
{ t = "Angle", x = 45, y = 26, to = SMLSIZE },

src/SCRIPTS/BF/X9/rx.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ return {
1414
{ t = "Interp", x = 110, y = 30, sp = 50, min = 0, max = 3, vals = { 13 }, to = SMLSIZE, table={ [0]="Off", "Preset", "Auto", "Manual"} },
1515
{ t = "Interp Int", x = 110, y = 40, sp = 50, min = 1, max = 50, vals = { 14 }, to = SMLSIZE },
1616
},
17-
}
17+
}

src/SCRIPTS/BF/X9/vtx.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,4 @@ return {
245245
end
246246
end
247247
end
248-
}
248+
}

src/SCRIPTS/BF/ui.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,18 @@ function run_ui(event)
354354
incValue(-1)
355355
end
356356
end
357+
local nextPage = currentPage
357358
while Page == nil do
358359
Page = assert(loadScript(radio.templateHome .. PageFiles[currentPage]))()
359-
if Page.requiredVersion and Page.requiredVersion > apiVersion then
360+
if Page.requiredVersion and apiVersion > 0 and Page.requiredVersion > apiVersion then
360361
incPage(1)
362+
363+
if currentPage == nextPage then
364+
lcd.clear()
365+
lcd.drawText(NoTelem[1], NoTelem[2], "No Pages! API: " .. apiVersion, NoTelem[4])
366+
367+
return 1
368+
end
361369
end
362370
end
363371
if not Page.values and currentState == pageStatus.display then

0 commit comments

Comments
 (0)