Skip to content

drivers/motor_driver: fix accidental braking#21847

Merged
crasbe merged 1 commit intoRIOT-OS:masterfrom
LeonardHerbst:origin/motor_driver
Nov 5, 2025
Merged

drivers/motor_driver: fix accidental braking#21847
crasbe merged 1 commit intoRIOT-OS:masterfrom
LeonardHerbst:origin/motor_driver

Conversation

@LeonardHerbst
Copy link
Copy Markdown
Contributor

Contribution description

When the motor driver mode is set to MOTOR_DRIVER_2_DIRS, the states of the DIR0 and DIR1 pins encode both the rotation direction and whether the motor should brake.
"Removing" the brakes causes both pins to be set to the inverse of the braking state. So, if the driver is configured to brake high, both pins will be set low, and vice versa. Most H-bridges will break both in the low and high state.

I also adjusted the phrasing in the documentation a bit.

@github-actions github-actions bot added the Area: drivers Area: Device drivers label Nov 5, 2025
@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 5, 2025
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Nov 5, 2025

Ping @gdoffe :)

@benpicco benpicco requested a review from maribu November 5, 2025 13:55
@riot-ci
Copy link
Copy Markdown

riot-ci commented Nov 5, 2025

Murdock results

✔️ PASSED

1a4491e drivers/motor_driver: fix accidental braking

Success Failures Total Runtime
10915 0 10916 09m:57s

Artifacts

@gdoffe
Copy link
Copy Markdown
Contributor

gdoffe commented Nov 5, 2025

Hi, @LeonardHerbst good catch !
Thanks for spotting that bug and sorry for it.

I totally agree with the fix. 👍

Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

Thanks for @gdoffe for confirming this :)

@crasbe crasbe enabled auto-merge November 5, 2025 14:07
@crasbe crasbe added this pull request to the merge queue Nov 5, 2025
Merged via the queue into RIOT-OS:master with commit 2a21229 Nov 5, 2025
28 checks passed
@LeonardHerbst
Copy link
Copy Markdown
Contributor Author

Hi, @LeonardHerbst good catch ! Thanks for spotting that bug and sorry for it.

I totally agree with the fix. 👍

Glad to help. And thanks for giving the motor driver an overhaul.

@LeonardHerbst LeonardHerbst deleted the origin/motor_driver branch December 1, 2025 09:46
@leandrolanzieri leandrolanzieri added this to the Release 2026.01 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants