Skip to content

Commit 24914d7

Browse files
jilaypandyakartben
authored andcommitted
drivers: stepper: api: add -ECANCELED error code for move operations
If the stepper is not enabled, calling any of the move operations shall return -ECANCELED Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
1 parent 857e579 commit 24914d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/zephyr/drivers/stepper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ static inline int z_impl_stepper_enable(const struct device *dev, const bool ena
233233
* @param dev pointer to the stepper motor controller instance
234234
* @param micro_steps target micro_steps to be moved from the current position
235235
*
236+
* @retval -ECANCELED If the stepper is disabled
236237
* @retval -EIO General input / output error
237238
* @retval 0 Success
238239
*/
@@ -374,6 +375,7 @@ static inline int z_impl_stepper_get_actual_position(const struct device *dev, i
374375
* @param dev pointer to the stepper motor controller instance
375376
* @param micro_steps target position to set in micro_steps
376377
*
378+
* @retval -ECANCELED If the stepper is disabled
377379
* @retval -EIO General input / output error
378380
* @retval -ENOSYS If not implemented by device driver
379381
* @retval 0 Success
@@ -425,6 +427,7 @@ static inline int z_impl_stepper_is_moving(const struct device *dev, bool *is_mo
425427
* - > 0: Run the stepper with the given velocity in a given direction
426428
* - 0: Stop the stepper
427429
*
430+
* @retval -ECANCELED If the stepper is disabled
428431
* @retval -EIO General input / output error
429432
* @retval -ENOSYS If not implemented by device driver
430433
* @retval 0 Success

0 commit comments

Comments
 (0)