File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,21 @@ local function processMspReply(cmd,rx_buf)
112
112
for i = 1 ,# (rx_buf ) do
113
113
Page .values [i ] = rx_buf [i ]
114
114
end
115
+
116
+ for i = 1 ,# (Page .fields ) do
117
+ if (# (Page .values ) or 0 ) >= Page .minBytes then
118
+ local f = Page .fields [i ]
119
+ if f .vals then
120
+ f .value = 0 ;
121
+ for idx = 1 , # (f .vals ) do
122
+ local raw_val = Page .values [f .vals [idx ]]
123
+ raw_val = bit32.lshift (raw_val , (idx - 1 )* 8 )
124
+ f .value = bit32.bor (f .value , raw_val )
125
+ end
126
+ f .value = f .value / (f .scale or 1 )
127
+ end
128
+ end
129
+ end
115
130
if Page .postLoad then
116
131
Page .postLoad (Page )
117
132
end
@@ -196,16 +211,6 @@ local function drawScreen()
196
211
else
197
212
spacing = 0
198
213
end
199
- if Page .values then
200
- if (# (Page .values ) or 0 ) >= Page .minBytes then
201
- if not f .value and f .vals then
202
- for idx = 1 , # (f .vals ) do
203
- f .value = bit32.bor ((f .value or 0 ), bit32.lshift (Page .values [f .vals [idx ]], (idx - 1 )* 8 ))
204
- end
205
- f .value = f .value / (f .scale or 1 )
206
- end
207
- end
208
- end
209
214
if f .value then
210
215
if f .upd and Page .values then
211
216
f .upd (Page )
You can’t perform that action at this time.
0 commit comments