Skip to content

Commit 3ccc4fc

Browse files
committed
enable some missing timers
1 parent 3433e4c commit 3ccc4fc

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- `timer.rs` refactoring
13+
1014
## [v0.11.0] - 2025-09-09
1115

1216
### Breaking changes

src/rcc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl Rcc {
207207
/// let clocks = rcc.freeze(rcc::Config::default(), &mut flash.acr);
208208
/// ```
209209
#[inline(always)]
210+
#[allow(unused)]
210211
pub fn freeze(self, cfg: impl Into<RawConfig>, acr: &mut ACR) -> Self {
211212
let cfg = cfg.into();
212213
let clocks = cfg.get_clocks();

src/timer.rs

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -956,32 +956,39 @@ hal!(pac::TIM7: [Timer7, u16, dbg_tim7_stop, m: tim6,]);
956956
#[cfg(all(feature = "stm32f103", feature = "high"))]
957957
hal!(pac::TIM8: [Timer8, u16, dbg_tim8_stop, c: (4, 4, _aoe), m: tim1,]);
958958

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+
/*
963+
#[cfg(feature = "xl")]
964+
hal!(pac::TIM9: [Timer9, u16, dbg_tim9_stop, c: (2, 2),]);
965+
#[cfg(feature = "xl")]
966+
hal!(pac::TIM10: [Timer10, u16, dbg_tim10_stop, c: (1, 1),]);
967+
#[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),]);
988+
959989
#[cfg(feature = "stm32f100")]
960990
hal!(pac::TIM15: [Timer15, u16, dbg_tim15_stop, c: (2, 2),]);
961991
#[cfg(feature = "stm32f100")]
962992
hal!(pac::TIM16: [Timer16, u16, dbg_tim16_stop, c: (1, 1),]);
963993
#[cfg(feature = "stm32f100")]
964994
hal!(pac::TIM17: [Timer17, u16, dbg_tim17_stop, c: (1, 1),]);
965-
966-
//TODO: restore these timers once stm32-rs has been updated
967-
/*
968-
* dbg_tim(12-13)_stop fields missing from 103 xl in stm32-rs
969-
* dbg_tim(9-10)_stop fields missing from 101 xl in stm32-rs
970-
#[cfg(any(
971-
feature = "xl",
972-
all(
973-
feature = "stm32f100",
974-
feature = "high",
975-
)))]
976-
hal! {
977-
TIM12: (tim12, dbg_tim12_stop),
978-
TIM13: (tim13, dbg_tim13_stop),
979-
TIM14: (tim14, dbg_tim14_stop),
980-
}
981-
#[cfg(feature = "xl")]
982-
hal! {
983-
TIM9: (tim9, dbg_tim9_stop),
984-
TIM10: (tim10, dbg_tim10_stop),
985-
TIM11: (tim11, dbg_tim11_stop),
986-
}
987-
*/

0 commit comments

Comments
 (0)