Add modbus integration
This commit is contained in:
parent
4edabc5c56
commit
2e6a3be100
5 changed files with 119 additions and 0 deletions
|
|
@ -61,6 +61,11 @@ func main() {
|
|||
}
|
||||
d.adcPirani = adc
|
||||
|
||||
err = d.modbusConnect()
|
||||
if err != nil {
|
||||
klog.Exitf("Failed to connect to modbus %v", err)
|
||||
}
|
||||
|
||||
for _, c := range []struct {
|
||||
out *gpio
|
||||
num int
|
||||
|
|
@ -92,5 +97,9 @@ func main() {
|
|||
}()
|
||||
|
||||
go d.process(ctx)
|
||||
if !flagFake {
|
||||
go d.modbusProcess(ctx)
|
||||
}
|
||||
|
||||
<-ctx.Done()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue