-
Notifications
You must be signed in to change notification settings - Fork 232
Delay
trait using core::time::Duration
#523
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
Comments
Another oddity: |
iirc this is because |
Fair enough, though perhaps it would still makes sense to design the API as I've outlined above? That way, people on 32-bit targets could still use the usual |
Thanks for pointing this out! This was due to a limitation in async functions in traits when it was added, but it's now possible so that's been fixed (see #535).
The problem is that the end users (who've picked a target) aren't the ones calling We have however just changed (in #537) the trait to permit nanosecond resolution, although many platforms likely will round up significantly (e.g. probably to the next highest µs). The hope is that one day we can invent a suitable |
Is there a reason that the
embedded_hal::delay::DelayUs
API is not defined as follows:I haven't actually implemented this API myself, but it seems like this would be both much cleaner, and much more flexible (e.g. allowing nanosecond resolution as well)?
Is the issue that
core::time::Duration
is too large to pass around?The text was updated successfully, but these errors were encountered: