12
12
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.8.0/examples/can.rs
13
13
14
14
use crate :: gpio:: { gpioa, gpiob} ;
15
- use crate :: gpio:: { PushPull , AF7 , AF9 } ;
15
+ use crate :: gpio:: { PushPull , AF9 } ;
16
16
use crate :: pac;
17
17
18
18
use crate :: rcc:: APB1 ;
@@ -28,16 +28,14 @@ pub trait RxPin: crate::private::Sealed {}
28
28
/// Marker trait for pins (with specific AF mode) that can be used as a CAN TX pin.
29
29
pub trait TxPin : crate :: private:: Sealed { }
30
30
31
- cfg_if ! {
32
- if #[ cfg( any( feature = "gpio-f302" , feature = "gpio-f303" ) ) ] {
33
- use crate :: gpio:: gpiod;
34
-
35
- impl RxPin for gpioa:: PA11 <AF9 <PushPull >> { }
36
- impl TxPin for gpioa:: PA12 <AF9 <PushPull >> { }
37
-
38
- impl RxPin for gpiob:: PB8 <AF9 <PushPull >> { }
39
- impl TxPin for gpiob:: PB9 <AF9 <PushPull >> { }
31
+ impl RxPin for gpioa:: PA11 < AF9 < PushPull > > { }
32
+ impl TxPin for gpioa:: PA12 < AF9 < PushPull > > { }
33
+ impl RxPin for gpiob:: PB8 < AF9 < PushPull > > { }
34
+ impl TxPin for gpiob:: PB9 < AF9 < PushPull > > { }
40
35
36
+ cfg_if ! {
37
+ if #[ cfg( any( feature = "gpio-f303" , feature = "gpio-f303e" , feature = "gpio-f373" ) ) ] {
38
+ use crate :: gpio:: { gpiod, AF7 } ;
41
39
impl RxPin for gpiod:: PD0 <AF7 <PushPull >> { }
42
40
impl TxPin for gpiod:: PD1 <AF7 <PushPull >> { }
43
41
}
0 commit comments