ssd1331 icon indicating copy to clipboard operation
ssd1331 copied to clipboard

Asyncify flush

Open jacobrosenthal opened this issue 4 years ago • 6 comments

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

jacobrosenthal avatar Nov 15 '21 22:11 jacobrosenthal

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.

jamwaffles avatar Nov 18 '21 12:11 jamwaffles

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

jacobrosenthal avatar Nov 20 '21 19:11 jacobrosenthal

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.

richard-uk1 avatar Nov 20 '21 20:11 richard-uk1

Id track here https://github.com/rust-embedded/embedded-hal/pull/285

and after that we need Prs to help the hals asyncify

jacobrosenthal avatar Nov 20 '21 21:11 jacobrosenthal

Well this is one way to do multiple target examples

jacobrosenthal avatar Nov 20 '21 23:11 jacobrosenthal

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.

quentinmit avatar Jul 10 '22 00:07 quentinmit