Skip to content

Commit 46bf2a8

Browse files
authored
Merge pull request #217 from datdenkikniet/fix_i2c_feature_gate
Make I2C1 available on PB8/PB9 combination for stm32l4x2
2 parents 62e15e8 + 8231af7 commit 46bf2a8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/i2c.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,17 @@ use crate::gpio::gpiob::{PB10, PB11, PB6, PB7};
478478
#[cfg(any(feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
479479
use crate::gpio::gpioc::{PC0, PC1};
480480

481-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x3", feature = "stm32l4x6"))]
481+
#[cfg(any(
482+
feature = "stm32l4x1",
483+
feature = "stm32l4x2",
484+
feature = "stm32l4x3",
485+
feature = "stm32l4x6",
486+
))]
482487
use crate::gpio::gpiob::PB8;
483488

489+
#[cfg(feature = "stm32l4x2")]
490+
use crate::gpio::gpiob::PB9;
491+
484492
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x6"))]
485493
use crate::gpio::gpiob::{PB13, PB14, PB9};
486494

@@ -490,7 +498,7 @@ pins!(I2C1, AF4,
490498

491499
pins!(I2C2, AF4, SCL: [PB10], SDA: [PB11]);
492500

493-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x6"))]
501+
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x6"))]
494502
pins!(I2C1, AF4, SCL: [PB8], SDA: [PB9]);
495503

496504
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x6"))]

0 commit comments

Comments
 (0)