diff --git a/src/blocking.rs b/src/blocking.rs index 5ff4959..1720807 100644 --- a/src/blocking.rs +++ b/src/blocking.rs @@ -1,6 +1,6 @@ //! Blocking APIs on top of the base radio traits //! -//! These implementations use the radio's DelayNs implementation to +//! These implementations use the radio's DelayUs implementation to //! poll on completion of operations. //! //! ## @@ -63,7 +63,7 @@ impl From for BlockingError { } /// Blocking transmit function implemented over `radio::Transmit` and `radio::Power` using the provided -/// `BlockingOptions` and radio-internal `DelayNs` impl to poll for completion +/// `BlockingOptions` and radio-internal `DelayUs` impl to poll for completion #[cfg_attr( feature = "mock", doc = r##" @@ -75,7 +75,7 @@ use radio::{BlockingTransmit, BlockingOptions}; # let mut radio = MockRadio::new(&[ # Transaction::start_transmit(vec![0xaa, 0xbb], None), # Transaction::check_transmit(Ok(false)), -# Transaction::delay_ns(100000), +# Transaction::delay_us(100), # Transaction::check_transmit(Ok(true)), # ]); # @@ -137,7 +137,7 @@ where } /// Blocking receive function implemented over `radio::Receive` using the provided `BlockingOptions` -/// and radio-internal `DelayNs` impl to poll for completion +/// and radio-internal `DelayUs` impl to poll for completion #[cfg_attr( feature = "mock", doc = r##" @@ -152,7 +152,7 @@ let info = BasicInfo::new(-81, 0); # let mut radio = MockRadio::new(&[ # Transaction::start_receive(None), # Transaction::check_receive(true, Ok(false)), -# Transaction::delay_ns(100000), +# Transaction::delay_us(100), # Transaction::check_receive(true, Ok(true)), # Transaction::get_received(Ok((data.to_vec(), info.clone()))), # ]); diff --git a/src/mock.rs b/src/mock.rs index 96fde02..3a0b90a 100644 --- a/src/mock.rs +++ b/src/mock.rs @@ -13,7 +13,7 @@ use std::vec::Vec; use log::debug; -use embedded_hal::delay::DelayNs; +use embedded_hal::delay::DelayUs; use embedded_hal_mock::common::Generic; @@ -217,9 +217,9 @@ impl Transaction { } /// Delay for a certain time - pub fn delay_ns(ns: u32) -> Self { + pub fn delay_us(us: u32) -> Self { Self { - request: Request::DelayNs(ns), + request: Request::DelayUs(us), response: Response::Ok, } } @@ -247,7 +247,7 @@ enum Request { CheckReceive(bool), GetReceived, - DelayNs(u32), + DelayUs(u32), } #[derive(Debug, Clone, PartialEq)] @@ -271,7 +271,7 @@ impl From> for Response { } } -impl DelayNs for Radio +impl DelayUs for Radio where St: PartialEq + Debug + Clone, Reg: PartialEq + Debug + Clone, @@ -280,10 +280,10 @@ where Irq: PartialEq + Debug + Clone, E: PartialEq + Debug + Clone, { - fn delay_ns(&mut self, ns: u32) { - let n = self.next().expect("no expectation for delay_ns call"); + fn delay_us(&mut self, us: u32) { + let n = self.next().expect("no expectation for delay_us call"); - assert_eq!(&n.request, &Request::DelayNs(ns)); + assert_eq!(&n.request, &Request::DelayUs(us)); } }