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

Use embedded-time #333

Closed
jessebraham opened this issue Nov 24, 2020 · 5 comments
Closed

Use embedded-time #333

jessebraham opened this issue Nov 24, 2020 · 5 comments
Assignees
Milestone

Comments

@jessebraham
Copy link
Contributor

Remove time.rs in favour of embedded-time. This will require reworking any peripheral implementations which use frequency and/or time units.

Work on this is already underway in #308.

@twitchyliquid64
Copy link
Contributor

Ive been working on this slowly with @jacobrosenthal in https://github.com/twitchyliquid64/atsamd/tree/EMBEDDED_TIEM.

One pain-point we are constantly running into the that embedded-time only converts Hertz<u64> into other types via the From trait, which is technically correct, but given we will never need a frequency > 4.1 Ghz this restriction just ends up being a pain.

I'm going to investigate ways to implement From<Hertz<u32>> so we can keep the existing behavior.

@sajattack
Copy link
Member

Ugh y they no TryFrom.

@twitchyliquid64
Copy link
Contributor

Theres TryFrom, but compared to just writing 400.Khz() / 20.MHz() etc everywhere, the TryFrom is unwieldy, not to mention we then need to import the TryFrom trait in each BSP crate.

@sajattack
Copy link
Member

Yeah it's not quite as clean but I think it makes sense to error if an invalid frequency is requested

@tgross35
Copy link
Contributor

I think this crate has switched to the better-supported fugit, so can this issue be closed?

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

No branches or pull requests

5 participants