Initialization fix

This commit is contained in:
2023-07-07 10:52:30 +03:00
parent 8de1094b93
commit 515a8db2c5
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -387,9 +387,14 @@ func initialize() {
protocolMap[key] = action{fields: fields, interval: 1000, name: PConverterDebug, object: cd}
}
// set "null" values
for _, element := range protocolMap {
var from uint8 = 0
for _, f := range element.fields {
f.value = ^uint64(0)
var mask uint64 = ^(ALL_BITS << f.length)
mask = mask << from
f.value = mask
from += 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)
c.GridVoltageLow = Voltage11BitType(val / 100)
}
func (c *CpuErrors) setGridVoltageHigh(val uint64) {
c.GridVoltageHigh = Voltage11BitType(val)
c.GridVoltageHigh = Voltage11BitType(val / 100)
}
func (c *CpuErrors) setGridVoltageEmpty(val uint64) {