drivers: stepper: adi_tmc: tmc5xxxx: fixed standstill detection

The standstill detection logic now stands corrected. Moving would
be indicated when the standstill bit is not zero.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
This commit is contained in:
Dipak Shetty 2025-05-08 23:27:57 +02:00 committed by Benjamin Cabé
commit 4c38b16f03
2 changed files with 2 additions and 2 deletions

View file

@ -341,7 +341,7 @@ static int tmc50xx_stepper_is_moving(const struct device *dev, bool *is_moving)
return -EIO;
}
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) == 1U);
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) != 1U);
LOG_DBG("Stepper motor controller %s is moving: %d", dev->name, *is_moving);
return 0;
}

View file

@ -394,7 +394,7 @@ static int tmc51xx_stepper_is_moving(const struct device *dev, bool *is_moving)
return -EIO;
}
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) == 1U);
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) != 1U);
LOG_DBG("Stepper motor controller %s is moving: %d", dev->name, *is_moving);
return 0;
}