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 of fugit instead of custom time implementation. #908

Open
liamkinne opened this issue Feb 19, 2024 · 2 comments
Open

Use of fugit instead of custom time implementation. #908

liamkinne opened this issue Feb 19, 2024 · 2 comments

Comments

@liamkinne
Copy link
Contributor

Would the maintainers be open to using fugit for the Instant and Duration rather than the custom implementation within this project?

Would save a bit of complexity in my code having to convert between the smoltcp types and the fugit types used by the SysTick library I'm using.

If someone gives the go ahead, I'm happy start working on a PR.

@Dirbaio
Copy link
Member

Dirbaio commented Feb 19, 2024

I personally think fugit is a bit hard to use with the u32/u64/etc and NUM/DENOM generics.

I'm not opposed to the idea, but only if there's a strong motivation beyond "some other library happens to use fugit", because there's other embedded libraries that use other types for time too.

besides, what timebase (NUM/DENOM) would smoltcp use for the time? still hardcode it to microseconds? in that case you'll still have to convert between that and whatever your microcontroller is using.

@liamkinne
Copy link
Contributor Author

Yeah I did think about the timebase problem. Fugit does have a method .convert() to handle different time bases. Given conversion is built-in, then I think a microsecond timebase would be fine and doesn't deviate from the current implementation.

Fugit makes the most sense to me because of it's ubiquity among HAL implementations and so in my mind having support for at least them is better than for none.

Other options are feature-gating the use of fugit or trying to make the time provider generic (my least favorite option to be clear).

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

No branches or pull requests

2 participants