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

Monotonic Implementation Difficulties #309

Closed
PTaylor-us opened this issue May 2, 2020 · 0 comments · Fixed by #436
Closed

Monotonic Implementation Difficulties #309

PTaylor-us opened this issue May 2, 2020 · 0 comments · Fixed by #436

Comments

@PTaylor-us
Copy link
Contributor

PTaylor-us commented May 2, 2020

I am working on a unified time-type library for embedded applications embedded-time. There is one considerable pain point trying to make it compatible with the Monotonic trait for use with RTFM. That is the requirement that the Duration must implement a special TryInto to convert into the System Timer ticks. This use of TryInto feels inappropriate.

What I would like to suggest is instead have the System Timer implement some trait (let's call it Clock). This Clock trait would require a Fraction/Ratio indicating the precision of the clock. In that way a TryInto could be implemented to convert a duration to a different precision.

This would be roughly in line with how time is handled in the std::chrono library in C++.

I'm going to look into creating an example implementation of this structure, but any suggestions/comments would be much appreciated.

@korken89 korken89 mentioned this issue Feb 25, 2021
@bors bors bot closed this as completed in #436 Mar 4, 2021
@bors bors bot closed this as completed in 89a5c80 Mar 4, 2021
andrewgazelka pushed a commit to andrewgazelka/cortex-m-rtic that referenced this issue Nov 3, 2021
309: Forward-port v0.6.12/13 changelog r=adamgreig a=jonas-schievink

Fixes rust-embedded/cortex-m-rt#299

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant