aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/i2c/mod.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs
index f77e68600..abda196a7 100644
--- a/embassy-stm32/src/i2c/mod.rs
+++ b/embassy-stm32/src/i2c/mod.rs
@@ -51,24 +51,24 @@ crate::pac::peripherals!(
51 }; 51 };
52); 52);
53 53
54crate::pac::peripheral_pins!( 54macro_rules! impl_pin {
55 ($inst:ident, i2c, I2C, $pin:ident, SDA, $af:expr) => { 55 ($inst:ident, $pin:ident, $signal:ident, $af:expr) => {
56 impl SdaPin<peripherals::$inst> for peripherals::$pin {} 56 impl $signal<peripherals::$inst> for peripherals::$pin {}
57 57
58 impl sealed::SdaPin<peripherals::$inst> for peripherals::$pin { 58 impl sealed::$signal<peripherals::$inst> for peripherals::$pin {
59 fn af_num(&self) -> u8 { 59 fn af_num(&self) -> u8 {
60 $af 60 $af
61 } 61 }
62 } 62 }
63 }; 63 };
64}
64 65
65 ($inst:ident, i2c, I2C, $pin:ident, SCL, $af:expr) => { 66crate::pac::peripheral_pins!(
66 impl SclPin<peripherals::$inst> for peripherals::$pin {} 67 ($inst:ident, i2c, I2C, $pin:ident, SDA, $af:expr) => {
68 impl_pin!($inst, $pin, SdaPin, $af);
69 };
67 70
68 impl sealed::SclPin<peripherals::$inst> for peripherals::$pin { 71 ($inst:ident, i2c, I2C, $pin:ident, SCL, $af:expr) => {
69 fn af_num(&self) -> u8 { 72 impl_pin!($inst, $pin, SclPin, $af);
70 $af
71 }
72 }
73 }; 73 };
74); 74);