-
Notifications
You must be signed in to change notification settings - Fork 170
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
Implement async Wait traits from embedded-hal-async #218
Conversation
Not sure why cargo fmt errors out on the trailing whitespace in the allow, but i fixed it. I also have a version of this that uses AtomicWaker instead of RefCell<Optional>, which is simpler, and doesn't require disabling interrupts to set the waker. It is also Sync, and the current solution is only Send because of RefCell. The downside is it requires the futures crate (or we have to copy the impl or find another). I would guess as more and more async is implemented, the likelihood you need futures at some point anyway is high. But it's your show :) Let me know if you want me to update this to the AtomicWaker version or not. . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have a few comments I think that should be addressed before we merge this :).
I've updated to use notifications. If you make one function in channel-bridge's Notification class public (poll_wait) we can reuse the crate. Let me know if you want me to make it not do anything until the first poll. |
cargo fmt seems to be having an issue with this according to the checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Looks good to me :)
@MabezDev This PR is very close to completion but still needs a few final small touches before merging. Given that the submitter might have moved after our strong disagreement what to do on pin drop I might be looking into it, but it will take some time. In any case, no rush - if you have time these days, you can of course also address my last set of comments. |
4515f7c
to
ab38c8e
Compare
I think I've addressed everything in the latest commit. |
Let's push it then? |
This patch implements the embedded-hal-async Wait trait, which enables
waiting on an level/edge for pins in an async fashion.
It has been tested on multiple esp32s3 devices in production