File tree 2 files changed +9
-21
lines changed
2 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 2
2
3
3
/// Microsecond delay
4
4
pub trait DelayUs {
5
- /// Enumeration of errors
6
- type Error : core:: fmt:: Debug ;
7
-
8
5
/// Pauses execution for at minimum `us` microseconds. Pause can be longer
9
6
/// if the implementation requires it due to precision/timing issues.
10
- async fn delay_us ( & mut self , us : u32 ) -> Result < ( ) , Self :: Error > ;
7
+ async fn delay_us ( & mut self , us : u32 ) ;
11
8
12
9
/// Pauses execution for at minimum `ms` milliseconds. Pause can be longer
13
10
/// if the implementation requires it due to precision/timing issues.
14
- async fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > ;
11
+ async fn delay_ms ( & mut self , ms : u32 ) ;
15
12
}
16
13
17
14
impl < T > DelayUs for & mut T
18
15
where
19
16
T : DelayUs ,
20
17
{
21
- type Error = T :: Error ;
22
-
23
- async fn delay_us ( & mut self , us : u32 ) -> Result < ( ) , Self :: Error > {
18
+ async fn delay_us ( & mut self , us : u32 ) {
24
19
T :: delay_us ( self , us) . await
25
20
}
26
21
27
- async fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
22
+ async fn delay_ms ( & mut self , ms : u32 ) {
28
23
T :: delay_ms ( self , ms) . await
29
24
}
30
25
}
Original file line number Diff line number Diff line change 3
3
/// Microsecond delay
4
4
///
5
5
pub trait DelayUs {
6
- /// Enumeration of `DelayUs` errors
7
- type Error : core:: fmt:: Debug ;
8
-
9
6
/// Pauses execution for at minimum `us` microseconds. Pause can be longer
10
7
/// if the implementation requires it due to precision/timing issues.
11
- fn delay_us ( & mut self , us : u32 ) -> Result < ( ) , Self :: Error > ;
8
+ fn delay_us ( & mut self , us : u32 ) ;
12
9
13
10
/// Pauses execution for at minimum `ms` milliseconds. Pause can be longer
14
11
/// if the implementation requires it due to precision/timing issues.
15
- fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
12
+ fn delay_ms ( & mut self , ms : u32 ) {
16
13
for _ in 0 ..ms {
17
- self . delay_us ( 1000 ) ? ;
14
+ self . delay_us ( 1000 ) ;
18
15
}
19
-
20
- Ok ( ( ) )
21
16
}
22
17
}
23
18
24
19
impl < T > DelayUs for & mut T
25
20
where
26
21
T : DelayUs ,
27
22
{
28
- type Error = T :: Error ;
29
-
30
- fn delay_us ( & mut self , us : u32 ) -> Result < ( ) , Self :: Error > {
23
+ fn delay_us ( & mut self , us : u32 ) {
31
24
T :: delay_us ( self , us)
32
25
}
33
26
34
- fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
27
+ fn delay_ms ( & mut self , ms : u32 ) {
35
28
T :: delay_ms ( self , ms)
36
29
}
37
30
}
You can’t perform that action at this time.
0 commit comments