diff --git a/CHANGELOG.md b/CHANGELOG.md index f1115cdd..40803809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed +- Connectivity line devices configuration supports ADC2 - replace `GetBusFreq` with `BusClock` and `BusTimerClock` ## [v0.8.0] - 2021-12-29 diff --git a/examples/adc.rs b/examples/adc.rs index fec13086..24338e14 100644 --- a/examples/adc.rs +++ b/examples/adc.rs @@ -27,7 +27,7 @@ fn main() -> ! { // Setup ADC let mut adc1 = adc::Adc::adc1(p.ADC1, clocks); - #[cfg(feature = "stm32f103")] + #[cfg(any(feature = "stm32f103", feature = "connectivity"))] let mut adc2 = adc::Adc::adc2(p.ADC2, clocks); // Setup GPIOB @@ -36,14 +36,14 @@ fn main() -> ! { // Configure pb0, pb1 as an analog input let mut ch0 = gpiob.pb0.into_analog(&mut gpiob.crl); - #[cfg(feature = "stm32f103")] + #[cfg(any(feature = "stm32f103", feature = "connectivity"))] let mut ch1 = gpiob.pb1.into_analog(&mut gpiob.crl); loop { let data: u16 = adc1.read(&mut ch0).unwrap(); hprintln!("adc1: {}", data).unwrap(); - #[cfg(feature = "stm32f103")] + #[cfg(any(feature = "stm32f103", feature = "connectivity"))] { let data1: u16 = adc2.read(&mut ch1).unwrap(); hprintln!("adc2: {}", data1).unwrap(); diff --git a/src/adc.rs b/src/adc.rs index 06ae15d5..e94ae159 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -15,7 +15,7 @@ use core::sync::atomic::{self, Ordering}; use cortex_m::asm::delay; use embedded_dma::StaticWriteBuffer; -#[cfg(feature = "stm32f103")] +#[cfg(any(feature = "stm32f103", feature = "connectivity"))] use crate::pac::ADC2; #[cfg(all(feature = "stm32f103", any(feature = "high", feature = "xl")))] use crate::pac::ADC3; @@ -137,7 +137,7 @@ adc_pins!(ADC1, gpioc::PC5 => 15_u8, ); -#[cfg(any(feature = "stm32f103",))] +#[cfg(any(feature = "stm32f103", feature = "connectivity"))] adc_pins!(ADC2, gpioa::PA0 => 0_u8, gpioa::PA1 => 1_u8, @@ -547,7 +547,7 @@ adc_hal! { ADC1: (adc1), } -#[cfg(feature = "stm32f103")] +#[cfg(any(feature = "stm32f103", feature = "connectivity"))] adc_hal! { ADC2: (adc2), }