Skip to content

Commit 4c38b16

Browse files
dipakgmxkartben
authored andcommitted
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>
1 parent f72f1eb commit 4c38b16

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/stepper/adi_tmc/tmc50xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static int tmc50xx_stepper_is_moving(const struct device *dev, bool *is_moving)
341341
return -EIO;
342342
}
343343

344-
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) == 1U);
344+
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) != 1U);
345345
LOG_DBG("Stepper motor controller %s is moving: %d", dev->name, *is_moving);
346346
return 0;
347347
}

drivers/stepper/adi_tmc/tmc51xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static int tmc51xx_stepper_is_moving(const struct device *dev, bool *is_moving)
394394
return -EIO;
395395
}
396396

397-
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) == 1U);
397+
*is_moving = (FIELD_GET(TMC5XXX_DRV_STATUS_STST_BIT, reg_value) != 1U);
398398
LOG_DBG("Stepper motor controller %s is moving: %d", dev->name, *is_moving);
399399
return 0;
400400
}

0 commit comments

Comments
 (0)