Add modbus integration

This commit is contained in:
hmelder 2024-11-10 01:47:01 +01:00 committed by Rahix
parent 4edabc5c56
commit 2e6a3be100
5 changed files with 119 additions and 0 deletions

View file

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