@@ -29,12 +29,12 @@ local lastRunTS = 0
2929local killEnterBreak = 0
3030local scrollPixelsY = 0
3131
32- Page = nil
32+ local Page = nil
3333
34- backgroundFill = backgroundFill or ERASE
35- foregroundColor = foregroundColor or SOLID
34+ local backgroundFill = TEXT_BGCOLOR or ERASE
35+ local foregroundColor = LINE_COLOR or SOLID
3636
37- globalTextOptions = globalTextOptions or 0
37+ local globalTextOptions = TEXT_COLOR or 0
3838
3939local function saveSettings (new )
4040 if Page .values then
@@ -120,16 +120,16 @@ local function processMspReply(cmd,rx_buf)
120120
121121 for i = 1 ,# (Page .fields ) do
122122 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
133133 end
134134 end
135135 if Page .postLoad then
@@ -139,22 +139,22 @@ local function processMspReply(cmd,rx_buf)
139139end
140140
141141local function incMax (val , inc , base )
142- return ((val + inc + base - 1 ) % base ) + 1
142+ return ((val + inc + base - 1 ) % base ) + 1
143143end
144144
145145local 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 ()
150150end
151151
152152local function incLine (inc )
153- currentLine = clipValue (currentLine + inc , 1 , # (Page .fields ))
153+ currentLine = clipValue (currentLine + inc , 1 , # (Page .fields ))
154154end
155155
156156local function incMenu (inc )
157- menuActive = clipValue (menuActive + inc , 1 , # (menuList ))
157+ menuActive = clipValue (menuActive + inc , 1 , # (menuList ))
158158end
159159
160160local function requestPage ()
@@ -201,7 +201,7 @@ local function drawScreen()
201201 local heading_options = text_options
202202 local value_options = text_options
203203 if i == currentLine then
204- value_options = text_options + INVERS
204+ value_options = text_options + INVERS
205205 if currentState == pageStatus .editing then
206206 value_options = value_options + BLINK
207207 end
0 commit comments