Simplify Timer feature config
@@ -14,16 +14,7 @@ use enumset::{EnumSet, EnumSetType};
use void::Void;
use crate::hal::timer::{CountDown, Periodic};
-#[cfg(any(
- feature = "stm32f301",
- feature = "stm32f302",
- feature = "stm32f303",
- feature = "stm32f334",
- feature = "stm32f318",
- feature = "stm32f328",
- feature = "stm32f358",
- feature = "stm32f398",
-))]
+#[cfg(not(feature = "gpio-f373"))]
use crate::pac::TIM1;
#[cfg(any(
feature = "stm32f303",
@@ -32,15 +23,11 @@ use crate::pac::TIM1;
feature = "stm32f398"
))]
use crate::pac::TIM20;
-#[cfg(any(
- feature = "stm32f303",
- feature = "stm32f328",
- feature = "stm32f358",
- feature = "stm32f373",
- feature = "stm32f378",
- feature = "stm32f398"
-))]
+#[cfg(not(feature = "svd-f301"))]
+use crate::pac::TIM3;
+#[cfg(not(any(feature = "svd-f301", feature = "svd-f3x4")))]
use crate::pac::TIM4;
+use crate::pac::TIM7;
#[cfg(any(
feature = "stm32f303",
feature = "stm32f328",
@@ -48,19 +35,9 @@ use crate::pac::TIM4;
feature = "stm32f398",
))]
use crate::pac::TIM8;
-#[cfg(any(feature = "stm32f373", feature = "stm32f378"))]
+#[cfg(feature = "gpio-f373")]
use crate::pac::{TIM12, TIM13, TIM14, TIM18, TIM19, TIM5};
use crate::pac::{TIM15, TIM16, TIM17, TIM2, TIM6};
-#[cfg(any(
- feature = "stm32f303",
- feature = "stm32f328",
- feature = "stm32f334",
- feature = "stm32f358",
- feature = "stm32f373",
- feature = "stm32f378",
- feature = "stm32f398"
-))]
-use crate::pac::{TIM3, TIM7};
use crate::rcc::{Clocks, APB1, APB2};
use crate::time::rate::*;
@@ -473,7 +450,7 @@ hal! {
},
}
-#[cfg(any(feature = "stm32f373", feature = "stm32f378"))]
+#[cfg(feature = "gpio-f373")]
hal! {
{
TIM2: (tim2, tim2en, tim2rst),
