This waiting is done blockingly, it should be done asynchronously in async code. This means we can share less code, but that's fine.
Once this is done, async timeouts should be simplified to using with_timeout at the top level, instead of passing a check_timeout closure through everywhere. This will ensure user timeouts also behave nicely when they use with_timeout themselves instead of using the builtin timeouts, or select.
Async and blocking currently share some "setup" code. This setup code needs to wait for some things, for example here:
https://github.com/embassy-rs/embassy/blob/a2d4bab2f8a4a9b994bc0289938a9f725950715f/embassy-stm32/src/i2c/v2.rs#L164
This waiting is done blockingly, it should be done asynchronously in async code. This means we can share less code, but that's fine.
Once this is done, async timeouts should be simplified to using
with_timeout
at the top level, instead of passing acheck_timeout
closure through everywhere. This will ensure user timeouts also behave nicely when they usewith_timeout
themselves instead of using the builtin timeouts, orselect
.