Initialization fix
This commit is contained in:
+6
-1
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user