From b6c0ddb7df86a8c5531ef6ae4c026b2e7175c96b Mon Sep 17 00:00:00 2001 From: Andres Oliva Date: Wed, 11 Oct 2023 23:05:12 +0200 Subject: [PATCH] Move the feature gates to the i2c module instead of the pub use statement --- embassy-stm32/src/i2c/mod.rs | 2 -- embassy-stm32/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 61989c23..d5bb2ed2 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs @@ -7,8 +7,6 @@ use crate::interrupt; #[cfg_attr(i2c_v1, path = "v1.rs")] #[cfg_attr(all(i2c_v2, feature = "time"), path = "v2.rs")] mod _version; - -#[cfg(any(i2c_v1, all(i2c_v2, feature = "time")))] pub use _version::*; use crate::peripherals; diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index e883678b..cfb78da3 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -41,7 +41,7 @@ pub mod flash; pub mod fmc; #[cfg(hrtim)] pub mod hrtim; -#[cfg(i2c)] +#[cfg(all(i2c, any(i2c_v1, all(i2c_v2, feature = "time"))))] pub mod i2c; #[cfg(all(spi_v1, rcc_f4))] pub mod i2s;