@@ -29,12 +29,12 @@ local lastRunTS = 0
29
29
local killEnterBreak = 0
30
30
local scrollPixelsY = 0
31
31
32
- Page = nil
32
+ local Page = nil
33
33
34
- backgroundFill = backgroundFill or ERASE
35
- foregroundColor = foregroundColor or SOLID
34
+ local backgroundFill = TEXT_BGCOLOR or ERASE
35
+ local foregroundColor = LINE_COLOR or SOLID
36
36
37
- globalTextOptions = globalTextOptions or 0
37
+ local globalTextOptions = TEXT_COLOR or 0
38
38
39
39
local function saveSettings (new )
40
40
if Page .values then
@@ -120,16 +120,16 @@ local function processMspReply(cmd,rx_buf)
120
120
121
121
for i = 1 ,# (Page .fields ) do
122
122
if (# (Page .values ) or 0 ) >= Page .minBytes then
123
- local f = Page .fields [i ]
124
- if f .vals then
125
- f .value = 0 ;
126
- for idx = 1 , # (f .vals ) do
127
- local raw_val = (Page .values [f .vals [idx ]] or 0 )
128
- raw_val = bit32.lshift (raw_val , (idx - 1 )* 8 )
129
- f .value = bit32.bor (f .value , raw_val )
130
- end
131
- f .value = f .value / (f .scale or 1 )
132
- end
123
+ local f = Page .fields [i ]
124
+ if f .vals then
125
+ f .value = 0 ;
126
+ for idx = 1 , # (f .vals ) do
127
+ local raw_val = (Page .values [f .vals [idx ]] or 0 )
128
+ raw_val = bit32.lshift (raw_val , (idx - 1 )* 8 )
129
+ f .value = bit32.bor (f .value , raw_val )
130
+ end
131
+ f .value = f .value / (f .scale or 1 )
132
+ end
133
133
end
134
134
end
135
135
if Page .postLoad then
@@ -139,22 +139,22 @@ local function processMspReply(cmd,rx_buf)
139
139
end
140
140
141
141
local function incMax (val , inc , base )
142
- return ((val + inc + base - 1 ) % base ) + 1
142
+ return ((val + inc + base - 1 ) % base ) + 1
143
143
end
144
144
145
145
local function incPage (inc )
146
- currentPage = incMax (currentPage , inc , # (PageFiles ))
147
- Page = nil
148
- currentLine = 1
149
- collectgarbage ()
146
+ currentPage = incMax (currentPage , inc , # (PageFiles ))
147
+ Page = nil
148
+ currentLine = 1
149
+ collectgarbage ()
150
150
end
151
151
152
152
local function incLine (inc )
153
- currentLine = clipValue (currentLine + inc , 1 , # (Page .fields ))
153
+ currentLine = clipValue (currentLine + inc , 1 , # (Page .fields ))
154
154
end
155
155
156
156
local function incMenu (inc )
157
- menuActive = clipValue (menuActive + inc , 1 , # (menuList ))
157
+ menuActive = clipValue (menuActive + inc , 1 , # (menuList ))
158
158
end
159
159
160
160
local function requestPage ()
@@ -201,7 +201,7 @@ local function drawScreen()
201
201
local heading_options = text_options
202
202
local value_options = text_options
203
203
if i == currentLine then
204
- value_options = text_options + INVERS
204
+ value_options = text_options + INVERS
205
205
if currentState == pageStatus .editing then
206
206
value_options = value_options + BLINK
207
207
end
0 commit comments