-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for embedded_hal_async::digital::Wait #91
Conversation
ac8a974
to
122553a
Compare
@cdunster hi, there are new conflicts introduced by other merges. Would you mind updating your branch? Thanks. |
122553a
to
79c2744
Compare
Hi @dbrgn, I've updated my branch. Thanks for looking into this PR. |
I gave this PR a try and it works well. Would be possible to add a configurable delay before these async functions resolve? In my code I use timeouts for control flow so I need a way to make these futures not resolve immediately. EDIT: This is what I had in mind: 7f69d31. |
79c2744
to
5fc63c0
Compare
Hi @avsaase, that looks good to me. I would prefer to make the delay an The only "problem" I see is that this makes |
5fc63c0
to
343674e
Compare
@cdunster looking great, thanks! Regarding the configurable delay: If such a delay would be added, is that something that should be added to other async mock method calls as well, not just digital pins? On the other hand, this method is explicitly about waiting, so a configurable wait time might make sense. However, the point about the tokio dependency is a valid one. Ideally, we'd have an executor-independent async sleep implementation, but I think that's not currently possible in Rust, right? In any case, I'll rebase and merge this PR for now. I'll tag a new release soon, but more features (even breaking changes) can always be added. If you're interested in a configurable delay, feel free to open a new PR, where it can be discussed. Edit: One downside of adding tokio as a dependency would be that it's harder to keep the MSRV. Tokio has a rolling MSRV, we currently have a fixed one. |
343674e
to
a3d06a7
Compare
This PR adds support for the async
Wait
trait from theembedded-hal-async
crate.