File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
14
14
15
15
### Changed
16
16
17
+ - Connectivity line devices configuration supports ADC2
17
18
- replace ` GetBusFreq ` with ` BusClock ` and ` BusTimerClock `
18
19
19
20
## [ v0.8.0] - 2021-12-29
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ fn main() -> ! {
27
27
// Setup ADC
28
28
let mut adc1 = adc:: Adc :: adc1 ( p. ADC1 , clocks) ;
29
29
30
- #[ cfg( feature = "stm32f103" ) ]
30
+ #[ cfg( any ( feature = "stm32f103" , feature = "connectivity" ) ) ]
31
31
let mut adc2 = adc:: Adc :: adc2 ( p. ADC2 , clocks) ;
32
32
33
33
// Setup GPIOB
@@ -36,14 +36,14 @@ fn main() -> ! {
36
36
// Configure pb0, pb1 as an analog input
37
37
let mut ch0 = gpiob. pb0 . into_analog ( & mut gpiob. crl ) ;
38
38
39
- #[ cfg( feature = "stm32f103" ) ]
39
+ #[ cfg( any ( feature = "stm32f103" , feature = "connectivity" ) ) ]
40
40
let mut ch1 = gpiob. pb1 . into_analog ( & mut gpiob. crl ) ;
41
41
42
42
loop {
43
43
let data: u16 = adc1. read ( & mut ch0) . unwrap ( ) ;
44
44
hprintln ! ( "adc1: {}" , data) . unwrap ( ) ;
45
45
46
- #[ cfg( feature = "stm32f103" ) ]
46
+ #[ cfg( any ( feature = "stm32f103" , feature = "connectivity" ) ) ]
47
47
{
48
48
let data1: u16 = adc2. read ( & mut ch1) . unwrap ( ) ;
49
49
hprintln ! ( "adc2: {}" , data1) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use core::sync::atomic::{self, Ordering};
15
15
use cortex_m:: asm:: delay;
16
16
use embedded_dma:: StaticWriteBuffer ;
17
17
18
- #[ cfg( feature = "stm32f103" ) ]
18
+ #[ cfg( any ( feature = "stm32f103" , feature = "connectivity" ) ) ]
19
19
use crate :: pac:: ADC2 ;
20
20
#[ cfg( all( feature = "stm32f103" , any( feature = "high" , feature = "xl" ) ) ) ]
21
21
use crate :: pac:: ADC3 ;
@@ -137,7 +137,7 @@ adc_pins!(ADC1,
137
137
gpioc:: PC5 <Analog > => 15_u8 ,
138
138
) ;
139
139
140
- #[ cfg( any( feature = "stm32f103" , ) ) ]
140
+ #[ cfg( any( feature = "stm32f103" , feature = "connectivity" ) ) ]
141
141
adc_pins ! ( ADC2 ,
142
142
gpioa:: PA0 <Analog > => 0_u8 ,
143
143
gpioa:: PA1 <Analog > => 1_u8 ,
@@ -547,7 +547,7 @@ adc_hal! {
547
547
ADC1 : ( adc1) ,
548
548
}
549
549
550
- #[ cfg( feature = "stm32f103" ) ]
550
+ #[ cfg( any ( feature = "stm32f103" , feature = "connectivity" ) ) ]
551
551
adc_hal ! {
552
552
ADC2 : ( adc2) ,
553
553
}
You can’t perform that action at this time.
0 commit comments