Skip to content
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

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

jilaypandya
Copy link
Contributor

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

fabiobaltieri
fabiobaltieri previously approved these changes Nov 27, 2024
@jilaypandya jilaypandya added the Enhancement Changes/Updates/Additions to existing features label Nov 27, 2024
dipakgmx
dipakgmx previously approved these changes Nov 27, 2024
faxe1008
faxe1008 previously approved these changes Nov 27, 2024
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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
Copy link
Collaborator

@kartben kartben Nov 28, 2024

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?

Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a 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 :)

faxe1008
faxe1008 previously approved these changes Nov 28, 2024
Copy link
Collaborator

@kartben kartben left a 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 :)

@jilaypandya
Copy link
Contributor Author

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 :)

faxe1008
faxe1008 previously approved these changes Dec 3, 2024
kartben
kartben previously approved these changes Dec 3, 2024
fabiobaltieri
fabiobaltieri previously approved these changes Dec 3, 2024
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]>
@jilaypandya
Copy link
Contributor Author

sorry guys, the CI should pass now

@kartben kartben merged commit af68d97 into zephyrproject-rtos:main Dec 4, 2024
24 checks passed
@jilaypandya jilaypandya deleted the feature/rename-run branch December 4, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Stepper Enhancement Changes/Updates/Additions to existing features Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stepper API: Rename motion control related functions
7 participants