diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0885066..f74102507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed the various `Default` marker traits. - Removed `&[W]` returned slice in `spi::blocking::Transfer`. - Require all associated error types to implement `core::fmt::Debug`. +- Simplified delay traits: removed `DelayMs`, changed `DelayUs` to use u32 instead of generic width integers. ### Removed - Removed random number generation (`rng`) traits in favor of [rand_core](https://crates.io/crates/rand_core). diff --git a/src/delay.rs b/src/delay.rs index f0a0475fd..eb32c8348 100644 --- a/src/delay.rs +++ b/src/delay.rs @@ -9,27 +9,12 @@ /// Blocking delay traits pub mod blocking { - /// Millisecond delay - /// - /// `UXX` denotes the range type of the delay time. `UXX` can be `u8`, `u16`, etc. A single type can - /// implement this trait for different types of `UXX`. - pub trait DelayMs { - /// Enumeration of `DelayMs` errors - type Error: core::fmt::Debug; - - /// Pauses execution for `ms` milliseconds - fn delay_ms(&mut self, ms: UXX) -> Result<(), Self::Error>; - } - - /// Microsecond delay - /// - /// `UXX` denotes the range type of the delay time. `UXX` can be `u8`, `u16`, etc. A single type can - /// implement this trait for different types of `UXX`. - pub trait DelayUs { - /// Enumeration of `DelayMs` errors + /// Simple microsecond delay + pub trait DelayUs { + /// Enumeration of `DelayUs` errors type Error: core::fmt::Debug; /// Pauses execution for `us` microseconds - fn delay_us(&mut self, us: UXX) -> Result<(), Self::Error>; + fn delay_us(&mut self, us: u32) -> Result<(), Self::Error>; } }