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:
parent
f72f1ebf6a
commit
4c38b16f03
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue