Skip to content

Commit dbdd980

Browse files
committed
updated loading for cms vs msp radio attributes
1 parent 7285a67 commit dbdd980

File tree

4 files changed

+47
-48
lines changed

4 files changed

+47
-48
lines changed

src/SCRIPTS/BF/cms.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lastMenuEventTime = 0
22

33
local function init()
4-
cms.init(radio.cmsConfig)
4+
cms.init(radio)
55
end
66

77
local function run(event)
@@ -10,10 +10,10 @@ local function run(event)
1010
if (cms.menuOpen == false) then
1111
cms.open()
1212
end
13-
if (event == radio.cmsConfig.refresh.event) then
13+
if (event == radio.refresh.event) then
1414
cms.refresh()
1515
end
16-
if (event == radio.cmsConfig.exit.event) then
16+
if (event == EVT_VIRTUAL_EXIT) then
1717
cms.close()
1818
return 1
1919
end

src/SCRIPTS/BF/radios.lua

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ local supportedRadios =
22
{
33
["128x64"] =
44
{
5-
templateHome = "TEMPLATES/128x64/",
6-
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
7-
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
8-
NoTelem = { 30, 55, "No Telemetry", BLINK },
9-
textSize = SMLSIZE,
10-
yMinLimit = 12,
11-
yMaxLimit = 52,
12-
cmsConfig = {
5+
msp = {
6+
templateHome = "TEMPLATES/128x64/",
7+
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
8+
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
9+
NoTelem = { 30, 55, "No Telemetry", BLINK },
10+
textSize = SMLSIZE,
11+
yMinLimit = 12,
12+
yMaxLimit = 52,
13+
},
14+
cms = {
1315
rows = 8,
1416
cols = 26,
1517
pixelsPerRow = 8,
@@ -23,21 +25,20 @@ local supportedRadios =
2325
top = 1,
2426
left = 64,
2527
},
26-
exit = {
27-
event = EVT_VIRTUAL_EXIT
28-
},
2928
},
3029
},
3130
["212x64"] =
3231
{
33-
templateHome = "TEMPLATES/212x64/",
34-
MenuBox = { x=40, y=12, w=120, x_offset=36, h_line=8, h_offset=3 },
35-
SaveBox = { x=40, y=12, w=120, x_offset=4, h=30, h_offset=5 },
36-
NoTelem = { 70, 55, "No Telemetry", BLINK },
37-
textSize = SMLSIZE,
38-
yMinLimit = 12,
39-
yMaxLimit = 52,
40-
cmsConfig = {
32+
msp = {
33+
templateHome = "TEMPLATES/212x64/",
34+
MenuBox = { x=40, y=12, w=120, x_offset=36, h_line=8, h_offset=3 },
35+
SaveBox = { x=40, y=12, w=120, x_offset=4, h=30, h_offset=5 },
36+
NoTelem = { 70, 55, "No Telemetry", BLINK },
37+
textSize = SMLSIZE,
38+
yMinLimit = 12,
39+
yMaxLimit = 52,
40+
},
41+
cms = {
4142
rows = 8,
4243
cols = 32,
4344
pixelsPerRow = 8,
@@ -50,23 +51,22 @@ local supportedRadios =
5051
text = "Refresh: [+]",
5152
top = 1,
5253
left = 156,
53-
},
54-
exit = {
55-
event = EVT_VIRTUAL_EXIT
5654
}
5755
},
5856
},
5957
["480x272"] =
6058
{
61-
templateHome = "TEMPLATES/480x272/",
62-
highRes = true,
63-
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 },
64-
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 },
65-
NoTelem = { 192, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
66-
textSize = 0,
67-
yMinLimit = 35,
68-
yMaxLimit = 235,
69-
cmsConfig = {
59+
msp = {
60+
templateHome = "TEMPLATES/480x272/",
61+
highRes = true,
62+
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 },
63+
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 },
64+
NoTelem = { 192, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
65+
textSize = 0,
66+
yMinLimit = 35,
67+
yMaxLimit = 235,
68+
},
69+
cms = {
7070
rows = 9,
7171
cols = 32,
7272
pixelsPerRow = 24,
@@ -79,23 +79,22 @@ local supportedRadios =
7979
text = "Refresh: [ENT]",
8080
top = 1,
8181
left = 300,
82-
},
83-
exit = {
84-
event = EVT_VIRTUAL_EXIT
8582
}
8683
},
8784
},
8885
["320x480"] =
8986
{
90-
templateHome = "TEMPLATES/320x480/",
91-
highRes = true,
92-
MenuBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=200, x_offset=68, h_line=20, h_offset=6 },
93-
SaveBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=180, x_offset=12, h=60, h_offset=12 },
94-
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
95-
textSize = 0,
96-
yMinLimit = 35,
97-
yMaxLimit = 435,
98-
cmsConfig = nil,
87+
msp = {
88+
templateHome = "TEMPLATES/320x480/",
89+
highRes = true,
90+
MenuBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=200, x_offset=68, h_line=20, h_offset=6 },
91+
SaveBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=180, x_offset=12, h=60, h_offset=12 },
92+
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
93+
textSize = 0,
94+
yMinLimit = 35,
95+
yMaxLimit = 435,
96+
},
97+
cms = nil,
9998
},
10099
}
101100

src/SCRIPTS/TOOLS/bf.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local scriptsCompiled = assert(loadScript("COMPILE/scripts_compiled.lua"))()
88

99
if scriptsCompiled then
1010
protocol = assert(loadScript("protocols.lua"))()
11-
radio = assert(loadScript("radios.lua"))()
11+
radio = assert(loadScript("radios.lua"))().msp
1212
assert(loadScript(protocol.mspTransport))()
1313
assert(loadScript("MSP/common.lua"))()
1414
run = assert(loadScript("ui.lua"))()

src/SCRIPTS/TOOLS/bfCms.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local scriptsCompiled = assert(loadScript("COMPILE/scripts_compiled.lua"))()
99
if scriptsCompiled then
1010
protocol = assert(loadScript("protocols.lua"))()
1111
local cmsTransport = assert(protocol.cmsTransport, "Telemetry protocol not supported!")
12-
radio = assert(loadScript("radios.lua"))()
12+
radio = assert(loadScript("radios.lua"))().cms
1313
assert(loadScript(cmsTransport))()
1414
assert(loadScript("CMS/common.lua"))()
1515
cms = assert(loadScript("cms.lua"))()

0 commit comments

Comments
 (0)