Skip to content

Commit cfa956c

Browse files
Johannes Draaijerkorken89
authored andcommitted
Fix usage of pin modes in SMI impl
1 parent c0c82fe commit cfa956c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples/pktgen.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ fn main() -> ! {
6363
rx_d1: gpioc.pc5,
6464
};
6565

66-
let mut mdio = gpioa.pa2.into_alternate().set_speed(Speed::VeryHigh);
67-
let mut mdc = gpioc.pc1.into_alternate().set_speed(Speed::VeryHigh);
66+
let mut mdio = gpioa.pa2.into_alternate();
67+
mdio.set_speed(Speed::VeryHigh);
68+
let mut mdc = gpioc.pc1.into_alternate();
69+
mdc.set_speed(Speed::VeryHigh);
6870

6971
let mut rx_ring: [RingEntry<_>; 16] = Default::default();
7072
let mut tx_ring: [RingEntry<_>; 8] = Default::default();

src/smi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ where
106106

107107
#[cfg(feature = "stm32f4xx-hal")]
108108
mod pin_impls {
109-
use crate::hal::gpio::{gpioa::PA2, gpioc::PC1, Alternate, PushPull};
109+
use crate::hal::gpio::{gpioa::PA2, gpioc::PC1, Alternate};
110110

111111
const AF11: u8 = 11;
112112

113-
unsafe impl super::MdioPin for PA2<Alternate<PushPull, AF11>> {}
114-
unsafe impl super::MdcPin for PC1<Alternate<PushPull, AF11>> {}
113+
unsafe impl super::MdioPin for PA2<Alternate<AF11>> {}
114+
unsafe impl super::MdcPin for PC1<Alternate<AF11>> {}
115115
}
116116

117117
#[cfg(feature = "stm32f7xx-hal")]

0 commit comments

Comments
 (0)