diff --git a/src/lib.rs b/src/lib.rs index e612ee1bc9c..a88b00e9e59 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ pub mod i2c; #[cfg(not(feature = "riscv-ulp-hal"))] pub mod interrupt; pub mod ledc; -#[cfg(any(esp32, esp32s3))] +#[cfg(all(any(esp32, esp32s3), not(feature = "riscv-ulp-hal")))] pub mod mcpwm; #[cfg(not(feature = "riscv-ulp-hal"))] pub mod mutex; diff --git a/src/mcpwm.rs b/src/mcpwm.rs index e33cd3f60b3..e4b9258fed6 100644 --- a/src/mcpwm.rs +++ b/src/mcpwm.rs @@ -1,3 +1,5 @@ +#![cfg(all(any(esp32, esp32s3), not(feature = "riscv-ulp-hal")))] + //! Motor Control Pulse Width Modulator peripheral //! //! Interface to the [Motor Control Pulse Width Modulator peripheral (MCPWM) diff --git a/src/peripherals.rs b/src/peripherals.rs index 9022c8af9d8..a7a6dc9bc02 100644 --- a/src/peripherals.rs +++ b/src/peripherals.rs @@ -14,7 +14,7 @@ use crate::hall; use crate::i2c; #[cfg(not(feature = "riscv-ulp-hal"))] use crate::ledc; -#[cfg(any(esp32, esp32s3))] +#[cfg(all(any(esp32, esp32s3), not(feature = "riscv-ulp-hal")))] use crate::mcpwm; #[cfg(not(feature = "riscv-ulp-hal"))] use crate::rmt; @@ -55,9 +55,9 @@ pub struct Peripherals { pub can: can::CAN, #[cfg(not(feature = "riscv-ulp-hal"))] pub ledc: ledc::Peripheral, - #[cfg(any(esp32, esp32s3))] + #[cfg(all(any(esp32, esp32s3), not(feature = "riscv-ulp-hal")))] pub mcpwm0: mcpwm::Peripheral, - #[cfg(any(esp32, esp32s3))] + #[cfg(all(any(esp32, esp32s3), not(feature = "riscv-ulp-hal")))] pub mcpwm1: mcpwm::Peripheral, #[cfg(not(feature = "riscv-ulp-hal"))] pub rmt: rmt::Peripheral,