File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,7 @@ mod sealed {
254
254
fn start_one_pulse ( & mut self ) ;
255
255
fn start_no_update ( & mut self ) ;
256
256
fn cr1_reset ( & mut self ) ;
257
+ fn cnt_reset ( & mut self ) ;
257
258
}
258
259
259
260
pub trait WithPwm : General {
@@ -381,6 +382,10 @@ macro_rules! hal {
381
382
fn cr1_reset( & mut self ) {
382
383
self . cr1. reset( ) ;
383
384
}
385
+ #[ inline( always) ]
386
+ fn cnt_reset( & mut self ) {
387
+ self . cnt. reset( ) ;
388
+ }
384
389
}
385
390
386
391
$( with_dmar!( $TIM, $memsize) ; ) ?
Original file line number Diff line number Diff line change @@ -310,6 +310,7 @@ where
310
310
let ( psc, arr) = compute_arr_presc ( period. raw ( ) , clk. raw ( ) ) ;
311
311
self . tim . set_prescaler ( psc) ;
312
312
self . tim . set_auto_reload ( arr) . unwrap ( ) ;
313
+ self . tim . cnt_reset ( ) ;
313
314
}
314
315
}
315
316
You can’t perform that action at this time.
0 commit comments