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

Fix issue with writing inital servo value before min/max is configured #2318

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

jan019
Copy link
Contributor

@jan019 jan019 commented Mar 24, 2024

Summary

The call to function Servo::write() in Servo::attach() must be done after Servo::min and Servo::max are configured - Servo::write() uses the min/max for mapping the passed value if the value is passed in degrees. Therefore if inital value in attach is set in degress and min/max is not configured when call to Servo::write() is done, the mapping will not be correct.

Fixes: #2308

The call to function Servo::write() in Servo::attach() must be done
after Servo::min and Servo::max are configured - Servo::write() uses the
min/max for mapping the passed value if the value is passed in degrees.
Therefore if inital value in attach is set in degress and min/max
is not configured when call to Servo::write() is done, the mapping will
not be correct.

Resolves: stm32duino#2308
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks @jan019.

@fpistm fpistm added bug 🐛 Something isn't working fix 🩹 Bug fix labels Mar 25, 2024
@fpistm fpistm added this to In progress in STM32 core based on ST HAL via automation Mar 25, 2024
@fpistm fpistm added this to the 2.8.0 milestone Mar 25, 2024
@fpistm fpistm merged commit f67f03b into stm32duino:main Mar 25, 2024
23 checks passed
STM32 core based on ST HAL automation moved this from In progress to Done Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working fix 🩹 Bug fix
Projects
2 participants