From 612a47ef4d09da3553145d77bf1750314bbb7b16 Mon Sep 17 00:00:00 2001 From: Finomnis Date: Fri, 1 Dec 2023 08:59:22 +0100 Subject: 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 --- rtic-sync/src/arbiter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rtic-sync/src/arbiter.rs') 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, 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(()) } }, -- cgit v1.2.3