Use End, not Empty

This commit is contained in:
Gregor Riepl 2021-01-31 18:44:43 +01:00
parent c5eab4ce6d
commit 0f20a327f2

View file

@ -56,7 +56,7 @@ func (c *Can) Handle(frame can.Frame) {
log.Printf("Data: 0x%02x 0x%02x", frame.Data[0], frame.Data[1])
c.swstate = obj.(FeedbackMessage)
// when all end switches are off: send stop command
if !c.swstate.EmptyD && !c.swstate.EmptyE && !c.swstate.EmptyF && !c.swstate.EmptyG && !c.swstate.EmptyH {
if !c.swstate.EndD && !c.swstate.EndE && !c.swstate.EndF && !c.swstate.EndG && !c.swstate.EndH {
log.Printf("All end switches off, stopping dispenser")
c.Cancel()
}