diff --git a/src/adc.rs b/src/adc.rs index 29f9fd9a..324fafef 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -1472,7 +1472,12 @@ macro_rules! adc_common { } fn clock(&self, clocks: &Clocks) -> Option { - use crate::pac::rcc::cfgr2::ADC1PRES; + #[cfg(feature = "svd-f301")] + use crate::pac::rcc::cfgr2::ADC1PRES as PRES; + + #[cfg(not(feature = "svd-f301"))] + use crate::pac::rcc::cfgr2::ADC12PRES as PRES; + use crate::pac::RCC; // SAFETY: atomic read with no side effects let adc_pres = unsafe { &(*RCC::ptr()).cfgr2().read().$adcXYpres() }; @@ -1485,19 +1490,19 @@ macro_rules! adc_common { Some(pllclk) if !adc_pres.is_no_clock() => { pllclk / match adc_pres.variant() { - Some(ADC1PRES::Div1) => 1, - Some(ADC1PRES::Div2) => 2, - Some(ADC1PRES::Div4) => 4, - Some(ADC1PRES::Div6) => 6, - Some(ADC1PRES::Div8) => 8, - Some(ADC1PRES::Div10) => 10, - Some(ADC1PRES::Div12) => 12, - Some(ADC1PRES::Div16) => 16, - Some(ADC1PRES::Div32) => 32, - Some(ADC1PRES::Div64) => 64, - Some(ADC1PRES::Div128) => 128, - Some(ADC1PRES::Div256) => 256, - Some(ADC1PRES::NoClock) | None => 1, + Some(PRES::Div1) => 1, + Some(PRES::Div2) => 2, + Some(PRES::Div4) => 4, + Some(PRES::Div6) => 6, + Some(PRES::Div8) => 8, + Some(PRES::Div10) => 10, + Some(PRES::Div12) => 12, + Some(PRES::Div16) => 16, + Some(PRES::Div32) => 32, + Some(PRES::Div64) => 64, + Some(PRES::Div128) => 128, + Some(PRES::Div256) => 256, + Some(PRES::NoClock) | None => 1, } } _ => { diff --git a/src/gpio.rs b/src/gpio.rs index e34e3d4b..6f109eb1 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -556,7 +556,7 @@ where #[cfg(feature = "svd-f373")] macro_rules! reg_for_cpu { ($exti:expr, $xr:ident) => { - $exti.$xr + $exti.$xr() }; }