File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
17
17
- Support for GPIO output slew rate configuration ([ #189 ] )
18
18
- Support for GPIO interrupts ([ #189 ] )
19
19
- ` ld ` feature, which enables the memory.x generation ([ #216 ] )
20
+ - Implement ` DelayMs ` for ` Milliseconds ` and ` DelayUs ` for ` Microseconds ` ([ #234 ] )
20
21
21
22
### Changed
22
23
@@ -322,6 +323,7 @@ let clocks = rcc
322
323
[ defmt ] : https://github.com/knurling-rs/defmt
323
324
[ filter ] : https://defmt.ferrous-systems.com/filtering.html
324
325
326
+ [ #234 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/234
325
327
[ #229 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/229
326
328
[ #227 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/227
327
329
[ #220 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/220
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ use cortex_m::peripheral::SYST;
12
12
13
13
use crate :: hal:: blocking:: delay:: { DelayMs , DelayUs } ;
14
14
use crate :: rcc:: Clocks ;
15
+ use crate :: time:: duration:: { Microseconds , Milliseconds } ;
16
+ use crate :: time:: fixed_point:: FixedPoint ;
15
17
16
18
/// System timer (SysTick) as a delay provider
17
19
pub struct Delay {
@@ -106,3 +108,15 @@ impl DelayUs<u8> for Delay {
106
108
self . delay_us ( u32:: from ( us) )
107
109
}
108
110
}
111
+
112
+ impl DelayUs < Microseconds > for Delay {
113
+ fn delay_us ( & mut self , us : Microseconds ) {
114
+ self . delay_us ( us. integer ( ) ) ;
115
+ }
116
+ }
117
+
118
+ impl DelayMs < Milliseconds > for Delay {
119
+ fn delay_ms ( & mut self , ms : Milliseconds ) {
120
+ self . delay_ms ( ms. integer ( ) ) ;
121
+ }
122
+ }
You can’t perform that action at this time.
0 commit comments