Bugfix in reading

This commit is contained in:
2023-07-07 15:50:34 +03:00
parent 515a8db2c5
commit 5d2c7e12fe
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -116,7 +116,6 @@ func StartProtocolParsing(frames <-chan *can.CanFrame) <-chan *Event {
var start uint8 = 0
for _, f := range param.fields {
if val, found := get(start, f.length, frame.Payload); found {
start += f.length
f.last = now
if f.value != val {
f.value = val
@@ -130,6 +129,7 @@ func StartProtocolParsing(frames <-chan *can.CanFrame) <-chan *Event {
}
}
}
start += f.length
}
}
+2 -2
View File
@@ -197,11 +197,11 @@ func (c *CpuErrors) setGridVoltageLowErr(val uint64) {
}
func (c *CpuErrors) setGridVoltageLow(val uint64) {
c.GridVoltageLow = Voltage11BitType(val / 100)
c.GridVoltageLow = Voltage11BitType(val)
}
func (c *CpuErrors) setGridVoltageHigh(val uint64) {
c.GridVoltageHigh = Voltage11BitType(val / 100)
c.GridVoltageHigh = Voltage11BitType(val)
}
func (c *CpuErrors) setGridVoltageEmpty(val uint64) {