diff options
| author | Finomnis <Finomnis@users.noreply.github.com> | 2023-12-01 08:59:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-01 07:59:22 +0000 |
| commit | 612a47ef4d09da3553145d77bf1750314bbb7b16 (patch) | |
| tree | 7f6f6beca7e0c81397994b4f835c6a7f0bbee331 /rtic-sync | |
| parent | 9f5820da1d36a8c84455b1bc0458d34eb7dd9a70 (diff) | |
Fix mono delay (#843)
* rtic-time: Compenstate for timer uncertainty
* Update changelog and incorrect cargo.lock in an example
* Fix Monotonic impls
* Fix tests
* Fix other monotonics, again
* Update changelog
* Fix example
* Fix DelayUs and DelayMs impls
* Minor coding style fix in u64 conversions
* Fix all changelogs
* Fix changelog
* Fix blocking DelayUs
* Minor monotonic rework
* Add delay precision test
* Add more tests
* Add rust-version tags to Cargo.toml
* Fix imxrt, rp2040 and systick timer
* Fix more monotonics
* Fix systick monotonic
* Some reverts
* Fix imxrt
* Fix nrf
* Fix rp2040
* Fix stm32
* Fix systick
* Fix rtic-time tests
* Bump to e-h.rc2
* Apply e-h.rc2 fixes to rtic-time
* Apply fixes from arbiter
* Fix clippy warning
* Minor beautification
* Revert previous changes
* Fix variable name
* Add blocking tests, but disable them by default
Diffstat (limited to 'rtic-sync')
| -rw-r--r-- | rtic-sync/Cargo.toml | 6 | ||||
| -rw-r--r-- | rtic-sync/src/arbiter.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/rtic-sync/Cargo.toml b/rtic-sync/Cargo.toml index 39f62dc..8172e26 100644 --- a/rtic-sync/Cargo.toml +++ b/rtic-sync/Cargo.toml @@ -21,9 +21,9 @@ heapless = "0.7" critical-section = "1" rtic-common = { version = "1.0.0", path = "../rtic-common" } portable-atomic = { version = "1", default-features = false } -embedded-hal = { version = "1.0.0-rc.1", optional = true } -embedded-hal-async = { version = "1.0.0-rc.1", optional = true } -embedded-hal-bus = { version = "0.1.0-rc.1", optional = true, features = ["async"] } +embedded-hal = { version = "1.0.0-rc.2", optional = true } +embedded-hal-async = { version = "1.0.0-rc.2", optional = true } +embedded-hal-bus = { version = "0.1.0-rc.2", optional = true, features = ["async"] } [dev-dependencies] tokio = { version = "1", features = ["rt", "macros", "time"] } diff --git a/rtic-sync/src/arbiter.rs b/rtic-sync/src/arbiter.rs index 99d4174..f0dbc4c 100644 --- a/rtic-sync/src/arbiter.rs +++ b/rtic-sync/src/arbiter.rs @@ -197,7 +197,7 @@ pub mod spi { use super::Arbiter; use embedded_hal::digital::OutputPin; use embedded_hal_async::{ - delay::DelayUs, + delay::DelayNs, spi::{ErrorType, Operation, SpiBus, SpiDevice}, }; use embedded_hal_bus::spi::DeviceError; @@ -229,7 +229,7 @@ pub mod spi { Word: Copy + 'static, BUS: SpiBus<Word>, CS: OutputPin, - D: DelayUs, + D: DelayNs, { async fn transaction( &mut self, @@ -246,10 +246,10 @@ pub mod spi { Operation::Write(buf) => bus.write(buf).await, Operation::Transfer(read, write) => bus.transfer(read, write).await, Operation::TransferInPlace(buf) => bus.transfer_in_place(buf).await, - Operation::DelayUs(us) => match bus.flush().await { + Operation::DelayNs(ns) => match bus.flush().await { Err(e) => Err(e), Ok(()) => { - self.delay.delay_us(*us).await; + self.delay.delay_ns(*ns).await; Ok(()) } }, |
