@@ -354,7 +354,7 @@ pub use pac::tim1::cr1::CMS as CenterAlignedMode;
354354mod sealed {
355355 use super :: {
356356 CaptureFilter , CaptureMode , CapturePolarity , CapturePrescaler , CenterAlignedMode , Event ,
357- IdleState , Ocm , Polarity , DBG ,
357+ IdleState , Ocm , Polarity ,
358358 } ;
359359 pub trait General {
360360 type Width : Into < u32 > + From < u16 > ;
@@ -376,7 +376,6 @@ mod sealed {
376376 fn start_one_pulse ( & mut self ) ;
377377 fn cr1_reset ( & mut self ) ;
378378 fn cnt_reset ( & mut self ) ;
379- fn stop_in_debug ( & mut self , dbg : & mut DBG , state : bool ) ;
380379 }
381380
382381 pub trait WithChannel : General {
@@ -422,15 +421,14 @@ mod sealed {
422421pub ( crate ) use sealed:: { Advanced , General , MasterTimer , WithCapture , WithChannel , WithPwm } ;
423422
424423pub trait Instance :
425- crate :: Sealed + rcc:: Enable + rcc:: Reset + rcc:: BusTimerClock + General
424+ crate :: Sealed + rcc:: Enable + rcc:: Reset + rcc:: BusTimerClock + rcc :: StopInDebug + General
426425{
427426}
428427
429428macro_rules! hal {
430429 ( $TIM: ty: [
431430 $Timer: ident,
432431 $bits: ty,
433- $dbg_timX_stop: ident,
434432 $( c: ( $cnum: tt, $ncnum: tt $( , $aoe: ident) ?) , ) ?
435433 $( m: $timbase: ident, ) ?
436434 ] ) => {
@@ -529,10 +527,6 @@ macro_rules! hal {
529527 fn cnt_reset( & mut self ) {
530528 self . cnt( ) . reset( ) ;
531529 }
532- #[ inline( always) ]
533- fn stop_in_debug( & mut self , dbg: & mut DBG , state: bool ) {
534- dbg. cr( ) . modify( |_, w| w. $dbg_timX_stop( ) . bit( state) ) ;
535- }
536530 }
537531 $(
538532 impl WithChannel for $TIM {
@@ -933,62 +927,46 @@ const fn compute_arr_presc(freq: u32, clock: u32) -> (u16, u32) {
933927}
934928
935929#[ cfg( any( feature = "stm32f100" , feature = "stm32f103" , feature = "connectivity" ) ) ]
936- hal ! ( pac:: TIM1 : [ Timer1 , u16 , dbg_tim1_stop , c: ( 4 , 4 , _aoe) , m: tim1, ] ) ;
930+ hal ! ( pac:: TIM1 : [ Timer1 , u16 , c: ( 4 , 4 , _aoe) , m: tim1, ] ) ;
937931
938- hal ! ( pac:: TIM2 : [ Timer2 , u16 , dbg_tim2_stop , c: ( 4 , 0 ) , m: tim2, ] ) ;
939- hal ! ( pac:: TIM3 : [ Timer3 , u16 , dbg_tim3_stop , c: ( 4 , 0 ) , m: tim2, ] ) ;
932+ hal ! ( pac:: TIM2 : [ Timer2 , u16 , c: ( 4 , 0 ) , m: tim2, ] ) ;
933+ hal ! ( pac:: TIM3 : [ Timer3 , u16 , c: ( 4 , 0 ) , m: tim2, ] ) ;
940934
941935#[ cfg( feature = "medium" ) ]
942- hal ! ( pac:: TIM4 : [ Timer4 , u16 , dbg_tim4_stop , c: ( 4 , 0 ) , m: tim2, ] ) ;
936+ hal ! ( pac:: TIM4 : [ Timer4 , u16 , c: ( 4 , 0 ) , m: tim2, ] ) ;
943937
944938#[ cfg( any( feature = "high" , feature = "connectivity" ) ) ]
945- hal ! ( pac:: TIM5 : [ Timer5 , u16 , dbg_tim5_stop , c: ( 4 , 0 ) , m: tim2, ] ) ;
939+ hal ! ( pac:: TIM5 : [ Timer5 , u16 , c: ( 4 , 0 ) , m: tim2, ] ) ;
946940
947941#[ cfg( any( feature = "stm32f100" , feature = "high" , feature = "connectivity" ) ) ]
948- hal ! ( pac:: TIM6 : [ Timer6 , u16 , dbg_tim6_stop , m: tim6, ] ) ;
942+ hal ! ( pac:: TIM6 : [ Timer6 , u16 , m: tim6, ] ) ;
949943
950944#[ cfg( any(
951945 all( feature = "high" , any( feature = "stm32f101" , feature = "stm32f103" ) ) ,
952946 any( feature = "stm32f100" , feature = "connectivity" )
953947) ) ]
954- hal ! ( pac:: TIM7 : [ Timer7 , u16 , dbg_tim7_stop , m: tim6, ] ) ;
948+ hal ! ( pac:: TIM7 : [ Timer7 , u16 , m: tim6, ] ) ;
955949
956950#[ cfg( all( feature = "stm32f103" , feature = "high" ) ) ]
957- hal ! ( pac:: TIM8 : [ Timer8 , u16 , dbg_tim8_stop , c: ( 4 , 4 , _aoe) , m: tim1, ] ) ;
951+ hal ! ( pac:: TIM8 : [ Timer8 , u16 , c: ( 4 , 4 , _aoe) , m: tim1, ] ) ;
958952
959- //TODO: restore these timers once stm32-rs has been updated
960- // dbg_tim(12-13)_stop fields missing from 103 xl in stm32-rs
961- // dbg_tim(9-10)_stop fields missing from 101 xl in stm32-rs
962- /*
963953#[ cfg( feature = "xl" ) ]
964- hal!(pac::TIM9: [Timer9, u16, dbg_tim9_stop, c: (2, 2),]);
954+ hal ! ( pac:: TIM9 : [ Timer9 , u16 , c: ( 2 , 2 ) , ] ) ;
965955#[ cfg( feature = "xl" ) ]
966- hal!(pac::TIM10: [Timer10, u16, dbg_tim10_stop, c: (1, 1),]);
956+ hal ! ( pac:: TIM10 : [ Timer10 , u16 , c: ( 1 , 1 ) , ] ) ;
967957#[ cfg( feature = "xl" ) ]
968- hal!(pac::TIM11: [Timer11, u16, dbg_tim11_stop, c: (1, 1),]);
969- */
970- #[ cfg( any(
971- all( feature = "stm32f100" , feature = "high" ) ,
972- all( feature = "stm32f101" , feature = "xl" ) ,
973- //all(feature = "stm32f103", feature = "xl"),
974- ) ) ]
975- hal ! ( pac:: TIM12 : [ Timer12 , u16 , dbg_tim12_stop, c: ( 2 , 2 ) , ] ) ;
976- #[ cfg( any(
977- all( feature = "stm32f100" , feature = "high" ) ,
978- all( feature = "stm32f101" , feature = "xl" ) ,
979- //all(feature = "stm32f103", feature = "xl"),
980- ) ) ]
981- hal ! ( pac:: TIM13 : [ Timer13 , u16 , dbg_tim13_stop, c: ( 1 , 1 ) , ] ) ;
982- #[ cfg( any(
983- all( feature = "stm32f100" , feature = "high" ) ,
984- all( feature = "stm32f101" , feature = "xl" ) ,
985- //all(feature = "stm32f103", feature = "xl"),
986- ) ) ]
987- hal ! ( pac:: TIM14 : [ Timer14 , u16 , dbg_tim14_stop, c: ( 1 , 1 ) , ] ) ;
958+ hal ! ( pac:: TIM11 : [ Timer11 , u16 , c: ( 1 , 1 ) , ] ) ;
959+
960+ #[ cfg( any( feature = "xl" , all( feature = "stm32f100" , feature = "high" ) ) ) ]
961+ hal ! ( pac:: TIM12 : [ Timer12 , u16 , c: ( 2 , 2 ) , ] ) ;
962+ #[ cfg( any( feature = "xl" , all( feature = "stm32f100" , feature = "high" ) ) ) ]
963+ hal ! ( pac:: TIM13 : [ Timer13 , u16 , c: ( 1 , 1 ) , ] ) ;
964+ #[ cfg( any( feature = "xl" , all( feature = "stm32f100" , feature = "high" ) ) ) ]
965+ hal ! ( pac:: TIM14 : [ Timer14 , u16 , c: ( 1 , 1 ) , ] ) ;
988966
989967#[ cfg( feature = "stm32f100" ) ]
990- hal ! ( pac:: TIM15 : [ Timer15 , u16 , dbg_tim15_stop , c: ( 2 , 2 ) , ] ) ;
968+ hal ! ( pac:: TIM15 : [ Timer15 , u16 , c: ( 2 , 2 ) , ] ) ;
991969#[ cfg( feature = "stm32f100" ) ]
992- hal ! ( pac:: TIM16 : [ Timer16 , u16 , dbg_tim16_stop , c: ( 1 , 1 ) , ] ) ;
970+ hal ! ( pac:: TIM16 : [ Timer16 , u16 , c: ( 1 , 1 ) , ] ) ;
993971#[ cfg( feature = "stm32f100" ) ]
994- hal ! ( pac:: TIM17 : [ Timer17 , u16 , dbg_tim17_stop , c: ( 1 , 1 ) , ] ) ;
972+ hal ! ( pac:: TIM17 : [ Timer17 , u16 , c: ( 1 , 1 ) , ] ) ;
0 commit comments