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: adi: tmc2209 minor fixes #82706

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

jilaypandya
Copy link
Contributor

@jilaypandya jilaypandya commented Dec 8, 2024

  1. The current implementation of tmc2209 driver does not allow instantiation of the driver without configuring msx pins.
    (Found by removing msx_gpios from overlay and then could not compile the driver)

  2. Second Commit renames direction-gpios to dir-gpios since STEP/DIR is a well established term in context of stepper controllers

@jilaypandya jilaypandya changed the title drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without… drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without msx Dec 8, 2024
@jilaypandya jilaypandya force-pushed the fix/tmc2209 branch 2 times, most recently from 9e95b7b to 478f0c9 Compare December 8, 2024 21:06
@jilaypandya jilaypandya changed the title drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without msx drivers: stepper: adi: tmc2209 minor fixes Dec 8, 2024
kartben
kartben previously approved these changes Dec 9, 2024
faxe1008
faxe1008 previously approved these changes Dec 9, 2024
Comment on lines 176 to 177
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios) \
, (.msx_pins = tmc22xx_stepper_msx_pins_##inst)) \
Copy link
Member

@fabiobaltieri fabiobaltieri Dec 9, 2024

Choose a reason for hiding this comment

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

is this clang-format?!

Suggested change
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios) \
, (.msx_pins = tmc22xx_stepper_msx_pins_##inst)) \
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios), ( \
.msx_pins = tmc22xx_stepper_msx_pins_##inst)) \

or some variation of that, if it's clang-format consider adding a /* clang-format off */ block

@jilaypandya jilaypandya dismissed stale reviews from faxe1008 and kartben via 38a8350 December 9, 2024 19:25
@jilaypandya jilaypandya force-pushed the fix/tmc2209 branch 2 times, most recently from 38a8350 to 8b80118 Compare December 9, 2024 19:28
Comment on lines 176 to 177
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios) \
, .msx_pins = tmc22xx_stepper_msx_pins_##inst) \
Copy link
Member

Choose a reason for hiding this comment

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

still there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the space after , ?
Parentheses I have removed

Copy link
Member

@fabiobaltieri fabiobaltieri Dec 9, 2024

Choose a reason for hiding this comment

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

the comma on the new line all alone, it should go on the previous one, the parenthesis I think you have to put it back, not totally sure about it though, see if it builds, my preferred format would be

IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios), (                               
        .msx_pins = tmc22xx_stepper_msx_pins_##inst,
))

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would go for a bold:

		IF_ENABLED(                                           \
                        DT_INST_NODE_HAS_PROP(inst, msx_gpios),       \
		        (.msx_pins = tmc22xx_stepper_msx_pins_##inst) \
                )					              \

Copy link
Member

Choose a reason for hiding this comment

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

yeah as long as there's no stray , dangling around, and I'd suggest keeping the , after ##inst otherwise it'd fail if you add something after it

… msx

The current implementation of tmc2209 driver does not allow instantiation
of the driver without configuring msx pins.

Signed-off-by: Jilay Pandya <[email protected]>
for the brevity renaming direction_gpios to dir_gpios since STEP/DIR
interface is quite an established term in context of stepper controllers.

Signed-off-by: Jilay Pandya <[email protected]>
@decsny decsny removed their request for review December 10, 2024 14:28
@kartben kartben merged commit d5ae99a into zephyrproject-rtos:main Dec 11, 2024
24 checks passed
@jilaypandya jilaypandya deleted the fix/tmc2209 branch December 19, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants