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

Asyncify flush #13

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jacobrosenthal
Copy link

Draft for discussion. Could support multiple traits, this could be the 'embassy' feature instead of async...

src/display.rs Outdated Show resolved Hide resolved
@jamwaffles
Copy link
Collaborator

this could be the 'embassy' feature instead of async

I think this is a good idea - Embassy might go away one day. Maybe call it async-embassy? That way we can have async-whatever for other executors if we need it.

@jacobrosenthal
Copy link
Author

Fixed the trait, but pr is still a bit of a mess

  • had to duplicate basically all of the send fn to make a send_async fn. I cant think of a good way to have the enum discriminants pulled into a From impl or something
  • I dont have a good dev board for the stm32f1 with an ssd1331 to attempt the embassy so its nrf52840 and optionally using multiple hals isnt a good solution.

But check it out does seem to work

@richard-uk1
Copy link

It would be awesome if eventually there were a rutime-agnostic set of async traits. We're not ready yet (need more experimentation) but it would be cool if just the traits from embassy became managed by embedded-wg or similar so that if someone wants to use a different runtime they can.

@jacobrosenthal
Copy link
Author

Id track here
rust-embedded/embedded-hal#285

and after that we need Prs to help the hals asyncify

@jacobrosenthal
Copy link
Author

Well this is one way to do multiple target examples

@jacobrosenthal jacobrosenthal marked this pull request as ready for review November 22, 2021 16:31
@quentinmit
Copy link

quentinmit commented Jul 10, 2022

I just looked into trying to use this, but it seems like sync operations are still used for non-flush operations?

Unfortunately I think that means that it can't be used with a proxy object from shared-bus, since it only provides async OR sync traits, but not both at the same time.

On the bright side, the async traits are now closer to standardized with the embedded-hal-async crate.

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

Successfully merging this pull request may close these issues.

4 participants