Initialization fix

refactor
Terekhin Alexandr 2 years ago
parent 8de1094b93
commit 515a8db2c5
Signed by: didinst
GPG Key ID: D2EF94423C23BF12
  1. 7
      yabl/init.go
  2. 4
      yabl/setters.go

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

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

Loading…
Cancel
Save