File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ struct State {
29
29
mod tests {
30
30
use super :: * ;
31
31
use defmt:: { self , assert, unwrap} ;
32
+ use testsuite:: GenericPair ;
32
33
33
34
#[ init]
34
35
fn init ( ) -> State {
@@ -39,6 +40,13 @@ mod tests {
39
40
let clocks = rcc. cfgr . freeze ( & mut flash. acr ) ;
40
41
let mut gpioc = dp. GPIOC . split ( & mut rcc. ahb ) ;
41
42
43
+ let pair = GenericPair {
44
+ 0 : gpioc. pc0 . into_analog ( & mut gpioc. moder , & mut gpioc. pupdr ) ,
45
+ 1 : gpioc
46
+ . pc1
47
+ . into_push_pull_output ( & mut gpioc. moder , & mut gpioc. otyper ) ,
48
+ } ;
49
+
42
50
State {
43
51
adc : Some ( adc:: Adc :: adc1 (
44
52
dp. ADC1 ,
@@ -47,10 +55,8 @@ mod tests {
47
55
adc:: CkMode :: default ( ) ,
48
56
clocks,
49
57
) ) ,
50
- analog : gpioc. pc0 . into_analog ( & mut gpioc. moder , & mut gpioc. pupdr ) ,
51
- output : gpioc
52
- . pc1
53
- . into_push_pull_output ( & mut gpioc. moder , & mut gpioc. otyper ) ,
58
+ analog : pair. 0 ,
59
+ output : pair. 1 ,
54
60
ahb : rcc. ahb ,
55
61
clocks,
56
62
adc1_2 : dp. ADC1_2 ,
You can’t perform that action at this time.
0 commit comments