-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: stepper: api: rename enable_constant_velocity_mode to run #82162
drivers: stepper: api: rename enable_constant_velocity_mode to run #82162
Conversation
include/zephyr/drivers/stepper.h
Outdated
@@ -164,13 +164,12 @@ typedef int (*stepper_set_target_position_t)(const struct device *dev, const int | |||
typedef int (*stepper_is_moving_t)(const struct device *dev, bool *is_moving); | |||
|
|||
/** | |||
* @brief Enable constant velocity mode for the stepper with a given velocity | |||
* @brief run the stepper with a given velocity in a given direction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief run the stepper with a given velocity in a given direction | |
* @brief Run the stepper with a given velocity in a given direction |
@@ -408,7 +407,7 @@ static inline int z_impl_stepper_is_moving(const struct device *dev, bool *is_mo | |||
} | |||
|
|||
/** | |||
* @brief Enable constant velocity mode for the stepper with a given velocity | |||
* @brief Run the stepper with a given velocity in a given direction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest renaming the value
parameter to velocity
as its name is now pretty vague otherwise. Please also fix inconsistency below as it says velocity is in steps/s in one place, and steps/us in another.
Also the @details
still mentions "constant velocity mode" which might be confusing?
0bf9ffa
56714db
to
0bf9ffa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like the new API name, the velocity_in_usteps_per_second
is a bit, wordy, I would go with velocity_ustep_sec
and expand its meaning in the @param
but its fine either way :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree with @bjarki-andreasen about the verbosity. Also, did you want to rename the value
parameter in the driver implementations too, for clarity? Also wonder about dropping "constant velocity" from L418-L419 in the stepper.h header, maybe just refer to "Run the stepper motor with the given ... / Stop the stepper motor"?
Will eventually approve if you don't feel like changing again, as it's probably borderline nitpicking :) just let me know :)
I like borderline nitpicking :-) waiting for #82283 to get merged, will then rebase and force push :) |
6b31b3c
0bf9ffa
to
6b31b3c
Compare
eea7e31
to
98b6b30
Compare
rename enable_constant_velocity_mode to run in following files: - include/zephyr/drivers/stepper.h - include/zephyr/drivers/stepper/stepper_fake.h - doc/hardware/peripherals/stepper.rst - doc/releases/migration-guide-4.1.rst - drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c - drivers/stepper/fake_stepper_controller.c - drivers/stepper/gpio_stepper_controller.c - drivers/stepper/stepper_shell.c - tests/drivers/stepper/shell/src/main.c Signed-off-by: Jilay Pandya <[email protected]>
1a6bb8a
98b6b30
to
1a6bb8a
Compare
sorry guys, the CI should pass now |
rename enable_constant_velocity_mode to run in following files: