File tree 2 files changed +14
-17
lines changed 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Removed
11
+ - Removed ` DelayMs ` in favor of ` DelayUs ` with ` u32 ` as type for clarity.
10
12
11
13
## [ v1.0.0-alpha.5] - 2021-09-11
12
14
Original file line number Diff line number Diff line change 9
9
10
10
/// Blocking delay traits
11
11
pub mod blocking {
12
- /// Millisecond delay
13
- ///
14
- /// `UXX` denotes the range type of the delay time. `UXX` can be `u8`, `u16`, etc. A single type can
15
- /// implement this trait for different types of `UXX`.
16
- pub trait DelayMs < UXX > {
17
- /// Enumeration of `DelayMs` errors
18
- type Error : core:: fmt:: Debug ;
19
-
20
- /// Pauses execution for `ms` milliseconds
21
- fn delay_ms ( & mut self , ms : UXX ) -> Result < ( ) , Self :: Error > ;
22
- }
23
-
24
12
/// Microsecond delay
25
13
///
26
- /// `UXX` denotes the range type of the delay time. `UXX` can be `u8`, `u16`, etc. A single type can
27
- /// implement this trait for different types of `UXX`.
28
- pub trait DelayUs < UXX > {
29
- /// Enumeration of `DelayMs` errors
14
+ pub trait DelayUs {
15
+ /// Enumeration of `DelayUs` errors
30
16
type Error : core:: fmt:: Debug ;
31
17
32
18
/// Pauses execution for `us` microseconds
33
- fn delay_us ( & mut self , us : UXX ) -> Result < ( ) , Self :: Error > ;
19
+ fn delay_us ( & mut self , us : u32 ) -> Result < ( ) , Self :: Error > ;
20
+
21
+ /// Pauses execution for `ms` milliseconds
22
+ fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
23
+ for _ in 0 ..ms {
24
+ self . delay_us ( 1000 ) ?;
25
+ }
26
+
27
+ Ok ( ( ) )
28
+ }
34
29
}
35
30
}
You can’t perform that action at this time.
0 commit comments