svena33 / sen5x-rs

This library provides an embedded `no_std` driver for the Sensirion SEN5x series
Other
1 stars 2 forks source link

async version #2

Open nebelgrau77 opened 2 weeks ago

nebelgrau77 commented 2 weeks ago

Hi,

As I needed to use your driver in an async function with embassy, I needed an async version. I managed to do it and it works, but it would be great to integrate it into your driver as feature. Here it is: https://github.com/nebelgrau77/sen5x-rs/tree/async_v01

As you'll see, it requires using the sensirion_i2c crate in the updated 0.4.0 version with async feature, embedded_hal_async, and some modifications to the sen5x module. I am not very practical with using features, let alone mutually exclusive as in this case, but I think we would need two selectable versions of this one module, and ideally conditional import of the dependencies.

What you you think?

svena33 commented 2 weeks ago

Thanks for sharing your work on making an async version of the driver. I agree that having async as a gated feature would be desirable. If you're open to contributing these changes to the repository, I'd be more than happy to support and review them!

nebelgrau77 commented 2 weeks ago

Hi,

Yes, that was my intention, I'd like to contribute. But I need to figure out how to make this work, the gated feature part. I hope to be back with some solution eventually :)