File tree Expand file tree Collapse file tree 2 files changed +9
-21
lines changed Expand file tree Collapse file tree 2 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 22
33/// Microsecond delay
44pub trait DelayUs {
5- /// Enumeration of errors
6- type Error : core:: fmt:: Debug ;
7-
85 /// Pauses execution for at minimum `us` microseconds. Pause can be longer
96 /// 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 ) ;
118
129 /// Pauses execution for at minimum `ms` milliseconds. Pause can be longer
1310 /// 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 ) ;
1512}
1613
1714impl < T > DelayUs for & mut T
1815where
1916 T : DelayUs ,
2017{
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 ) {
2419 T :: delay_us ( self , us) . await
2520 }
2621
27- async fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
22+ async fn delay_ms ( & mut self , ms : u32 ) {
2823 T :: delay_ms ( self , ms) . await
2924 }
3025}
Original file line number Diff line number Diff line change 33/// Microsecond delay
44///
55pub trait DelayUs {
6- /// Enumeration of `DelayUs` errors
7- type Error : core:: fmt:: Debug ;
8-
96 /// Pauses execution for at minimum `us` microseconds. Pause can be longer
107 /// 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 ) ;
129
1310 /// Pauses execution for at minimum `ms` milliseconds. Pause can be longer
1411 /// 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 ) {
1613 for _ in 0 ..ms {
17- self . delay_us ( 1000 ) ? ;
14+ self . delay_us ( 1000 ) ;
1815 }
19-
20- Ok ( ( ) )
2116 }
2217}
2318
2419impl < T > DelayUs for & mut T
2520where
2621 T : DelayUs ,
2722{
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 ) {
3124 T :: delay_us ( self , us)
3225 }
3326
34- fn delay_ms ( & mut self , ms : u32 ) -> Result < ( ) , Self :: Error > {
27+ fn delay_ms ( & mut self , ms : u32 ) {
3528 T :: delay_ms ( self , ms)
3629 }
3730}
You can’t perform that action at this time.
0 commit comments