-
Notifications
You must be signed in to change notification settings - Fork 211
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
Generic Delay implementation #103
Comments
I fully agree there's plenty of room for improvement. We do need to be a bit careful about how we design something generic so it can actually be used by any implementation and will lead to efficient code everywhere (especially division operations can be problematic). I'm not quite sure how ergonomic your suggestion would be in real life, it would be great to have an implementation available to play with it on different systems to get a feel how it might work. |
the timer can implement an |
That would indeed be ergonomic. But will it actually blend? 😅 |
Almost all the hal implementations:
Hz
I think that this can be solved in embedded-hal by:
CalibratedCountDown
that provide the needed function to implement delayCalibratedCountDown
that provide theDelay
implementation.Then, the hal only have to provide a
CalibratedCountDown
object that can be created from a timer and aClock
object.An idea of the implementation:
Then you can generically implement Delay as atsamd-rs/atsamd#14
The text was updated successfully, but these errors were encountered: