@@ -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