rtic-monotonics: Fix stm32-metapac use

Previously, the stm32 monotonics only compiled for some chip families. For
example, stm32g081kb worked, but not stm32f407*.

The stm32-metapac does not directly unify peripheral names between the
many stm32 families, but provides tools for build scripts to generate
code that uses the right names for the selected chip. Use that mechanism
instead of targeting a specific family.
This commit is contained in:
Nils Fitinghoff 2023-10-02 16:17:39 +02:00 committed by Henrik Tjäder
parent 3143b7e0ca
commit 8824202c5a
4 changed files with 194 additions and 36 deletions

View file

@ -43,7 +43,12 @@ nrf5340-net-pac = { version = "0.12.2", optional = true }
nrf9160-pac = { version = "0.12.2", optional = true }
# STM32
stm32-metapac = { version = "14.0.0", features = ["metadata"], optional = true }
stm32-metapac = { version = "14.0.0", optional = true }
[build-dependencies]
proc-macro2 = { version = "1.0.36", optional = true }
quote = { version = "1.0.15", optional = true }
stm32-metapac = { version = "14.0.0", default-features = false, features = ["metadata"], optional = true }
[features]
default = []
@ -78,6 +83,8 @@ stm32_tim5 = []
stm32_tim12 = []
stm32_tim15 = []
stm32-metapac = ["dep:stm32-metapac", "dep:quote", "dep:proc-macro2"]
# Maintainers: this `stm32-metapac` feature list is taken from:
# https://github.com/embassy-rs/embassy/blob/2e6f4237f2410aa18c9866a5a1a5ed1f3bec8a4e/embassy-stm32/Cargo.toml#L143
# It should be updated if `stm32-metapac` version changes because it might contain new chip definitions.