embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.52k stars 768 forks source link

duplicate of embassy-time causes timers to have wrong wall time #1115

Closed TheButlah closed 11 months ago

TheButlah commented 1 year ago

Problem: If your embassy-time is duplicated in your dependency graph, such as if cargo was using both the git version and the crates.io version at the same time, delays have the wrong wall time. For example, a 100ms delay beecomes a 3-4 second delay on the nrf52840 that I tested on.

Minimally reproducible example: https://github.com/SlimeVR/SlimeVR-Rust/blob/cfd00854a08e65fcb4d2946628ba4438531b829f/firmware/src/main.rs

Link to matrix discussion: https://matrix.to/#/!YoLPkieCYHGzdjUhOK:matrix.org/$7Akm6Lr0veuUuq2QLHCzpZaHfDjrUe_yK0J-5UFkWPQ?via=matrix.org&via=grusbv.com&via=community.rs

The solution to this was to patch the crates.io version of embassy-time with the git version.

plaes commented 11 months ago

@Dirbaio Possibly fixed with embassy-time-1.0.5 via https://github.com/embassy-rs/embassy/pull/2074 ?

Dirbaio commented 11 months ago

yep, thanks!