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

Added an update future, to be able to sync user code with interrupt #3199

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

smeenka
Copy link
Contributor

@smeenka smeenka commented Jul 19, 2024

For motor control with SimplePwm it would be nice that in user land it is possible to run code in sync with the Pwm.
For example to measure the motor current on a exact moment, and exact in phase with the Pwm signal.
So I added an UpdateFuture, to SimplePwm, making use of the already existing infrastructure (up_waker in State)
A test is added in stm32go named pwm_update_interrupt, to test the functionality

To be able to sync multiple timers, so they have all the same phase I also added a reset function to the SimplePwm.

@smeenka
Copy link
Contributor Author

smeenka commented Jul 20, 2024

Need some help to fix the failing formatting test

@lulf
Copy link
Member

lulf commented Aug 2, 2024

@smeenka You can run cargo +nightly fmt to make sure it can use the nightly fmt features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants