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/).
1717- Support for GPIO output slew rate configuration ([ #189 ] )
1818- Support for GPIO interrupts ([ #189 ] )
1919- ` ld ` feature, which enables the memory.x generation ([ #216 ] )
20+ - Implement ` DelayMs ` for ` Milliseconds ` and ` DelayUs ` for ` Microseconds ` ([ #234 ] )
2021
2122### Changed
2223
@@ -322,6 +323,7 @@ let clocks = rcc
322323[ defmt ] : https://github.com/knurling-rs/defmt
323324[ filter ] : https://defmt.ferrous-systems.com/filtering.html
324325
326+ [ #234 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/234
325327[ #229 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/229
326328[ #227 ] : https://github.com/stm32-rs/stm32f3xx-hal/pull/227
327329[ #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;
1212
1313use crate :: hal:: blocking:: delay:: { DelayMs , DelayUs } ;
1414use crate :: rcc:: Clocks ;
15+ use crate :: time:: duration:: { Microseconds , Milliseconds } ;
16+ use crate :: time:: fixed_point:: FixedPoint ;
1517
1618/// System timer (SysTick) as a delay provider
1719pub struct Delay {
@@ -106,3 +108,15 @@ impl DelayUs<u8> for Delay {
106108 self . delay_us ( u32:: from ( us) )
107109 }
108110}
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