You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The I2c trait from embedded-hal-async would allow this crate's usage with embassy.
Unfortunately, I can only think of hacky solutions to support both blocking and async:
Make a second copy of all the functions, doing the rote fn -> async fn transformation and sprinkling in some .await calls
Macro magic to define two copies using the same source
and then another question is:
Keep the same type names and swap in async using a feature, or
Expose the methods on a different type or in a different module (still feature-gated).
I asked in rust-embedded/embedded-hal#356 if there's any best practice here. I think most of the other crates I've seen have gone for some form of duplicate code.
The text was updated successfully, but these errors were encountered:
The
I2c
trait fromembedded-hal-async
would allow this crate's usage withembassy
.Unfortunately, I can only think of hacky solutions to support both blocking and async:
fn
->async fn
transformation and sprinkling in some.await
callsand then another question is:
async
using a feature, orI asked in rust-embedded/embedded-hal#356 if there's any best practice here. I think most of the other crates I've seen have gone for some form of duplicate code.
The text was updated successfully, but these errors were encountered: