Skip to content

Commit 45cc12a

Browse files
committed
Further simplify use statements in serial
1 parent 3d5d060 commit 45cc12a

File tree

1 file changed

+9
-54
lines changed

1 file changed

+9
-54
lines changed

src/serial.rs

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,8 @@ use crate::stm32::UART4;
3030
#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))]
3131
use crate::stm32::UART5;
3232

33-
use crate::gpio::gpioa::{PA0, PA1, PA10, PA11, PA12, PA2, PA3, PA9};
34-
use crate::gpio::gpiob::{PB3, PB4, PB6, PB7};
35-
use crate::gpio::gpiod::{PD3, PD4, PD5, PD6};
36-
use crate::gpio::{self, Alternate, Floating, Input};
37-
38-
#[cfg(any(
39-
feature = "stm32l4x2",
40-
feature = "stm32l4x3",
41-
feature = "stm32l4x5",
42-
feature = "stm32l4x6",
43-
))]
44-
use crate::gpio::gpioa::PA6;
45-
46-
#[cfg(any(
47-
feature = "stm32l4x2",
48-
feature = "stm32l4x3",
49-
feature = "stm32l4x5",
50-
feature = "stm32l4x6",
51-
))]
52-
use crate::gpio::gpiob::{PB1, PB10, PB11, PB13, PB14};
53-
54-
#[cfg(any(
55-
feature = "stm32l4x2",
56-
feature = "stm32l4x3",
57-
feature = "stm32l4x5",
58-
feature = "stm32l4x6",
59-
))]
60-
use crate::gpio::gpiod::{PD11, PD12, PD2};
61-
62-
#[cfg(any(
63-
feature = "stm32l4x2",
64-
feature = "stm32l4x3",
65-
feature = "stm32l4x5",
66-
feature = "stm32l4x6",
67-
))]
68-
use crate::gpio::gpioc::{PC10, PC11, PC4, PC5};
69-
70-
#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))]
71-
use crate::gpio::gpioa::PA15;
72-
73-
#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))]
74-
use crate::gpio::gpiob::PB5;
75-
76-
#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))]
77-
use crate::gpio::gpioc::PC12;
78-
7933
use crate::dma::{dma1, CircBuffer, DMAFrame, FrameReader, FrameSender};
34+
use crate::gpio::{self, Alternate, Floating, Input};
8035
use crate::rcc::{Clocks, APB1R1, APB2};
8136
use crate::time::{Bps, U32Ext};
8237

@@ -807,30 +762,30 @@ macro_rules! impl_pin_traits {
807762
$(
808763
$(
809764
impl private::SealedTx for
810-
$tx<Alternate<gpio::$af, Input<Floating>>> {}
765+
gpio::$tx<Alternate<gpio::$af, Input<Floating>>> {}
811766
impl TxPin<$instance> for
812-
$tx<Alternate<gpio::$af, Input<Floating>>> {}
767+
gpio::$tx<Alternate<gpio::$af, Input<Floating>>> {}
813768
)*
814769

815770
$(
816771
impl private::SealedRx for
817-
$rx<Alternate<gpio::$af, Input<Floating>>> {}
772+
gpio::$rx<Alternate<gpio::$af, Input<Floating>>> {}
818773
impl RxPin<$instance> for
819-
$rx<Alternate<gpio::$af, Input<Floating>>> {}
774+
gpio::$rx<Alternate<gpio::$af, Input<Floating>>> {}
820775
)*
821776

822777
$(
823778
impl private::SealedRtsDe for
824-
$rts_de<Alternate<gpio::$af, Input<Floating>>> {}
779+
gpio::$rts_de<Alternate<gpio::$af, Input<Floating>>> {}
825780
impl RtsDePin<$instance> for
826-
$rts_de<Alternate<gpio::$af, Input<Floating>>> {}
781+
gpio::$rts_de<Alternate<gpio::$af, Input<Floating>>> {}
827782
)*
828783

829784
$(
830785
impl private::SealedCts for
831-
$cts<Alternate<gpio::$af, Input<Floating>>> {}
786+
gpio::$cts<Alternate<gpio::$af, Input<Floating>>> {}
832787
impl CtsPin<$instance> for
833-
$cts<Alternate<gpio::$af, Input<Floating>>> {}
788+
gpio::$cts<Alternate<gpio::$af, Input<Floating>>> {}
834789
)*
835790
)*
836791
)*

0 commit comments

Comments
 (0)