EEBus: fix failsafe limit not left (#25578)

This commit is contained in:
roethigj 2025-11-26 17:12:47 +01:00 • committed by GitHub
parent 8358816eed
commit 97e8ac19cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,7 +172,8 @@ func (c *EEBus) Run() {
// TODO check state machine against spec
func (c *EEBus) run() error {
c.mux.RLock()
defer c.mux.RUnlock()
c.mux.Lock()
defer c.mux.Unlock()
c.log.TRACE.Println("status:", c.status)
@ -219,7 +220,7 @@ func (c *EEBus) run() error {
case StatusFailsafe:
// LPC-914/2
if d := c.failsafeDuration; heartbeatErr == nil && time.Since(c.statusUpdated) > d {
if d := c.failsafeDuration; heartbeatErr == nil || time.Since(c.statusUpdated) > d {
c.log.DEBUG.Println("heartbeat returned and failsafe duration exceeded- return to normal")
c.setStatusAndLimit(StatusUnlimited, 0)
}