diff options
| -rw-r--r-- | embassy-stm32/Cargo.toml | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/subghz/timeout.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/subghz/tx_params.rs | 1 |
5 files changed, 9 insertions, 2 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 9194ae788..c598604bd 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -82,9 +82,12 @@ memory-x = ["stm32-metapac/memory-x"] | |||
| 82 | subghz = [] | 82 | subghz = [] |
| 83 | exti = [] | 83 | exti = [] |
| 84 | 84 | ||
| 85 | # Enables additional driver features that depend on embassy-time | ||
| 86 | time = ["dep:embassy-time"] | ||
| 87 | |||
| 85 | # Features starting with `_` are for internal use only. They're not intended | 88 | # Features starting with `_` are for internal use only. They're not intended |
| 86 | # to be enabled by other crates, and are not covered by semver guarantees. | 89 | # to be enabled by other crates, and are not covered by semver guarantees. |
| 87 | _time-driver = ["dep:embassy-time"] | 90 | _time-driver = ["time"] |
| 88 | time-driver-any = ["_time-driver"] | 91 | time-driver-any = ["_time-driver"] |
| 89 | time-driver-tim2 = ["_time-driver"] | 92 | time-driver-tim2 = ["_time-driver"] |
| 90 | time-driver-tim3 = ["_time-driver"] | 93 | time-driver-tim3 = ["_time-driver"] |
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index f4f64992c..f898fcc8b 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -7,7 +7,9 @@ use crate::interrupt::Interrupt; | |||
| 7 | mod _version; | 7 | mod _version; |
| 8 | pub use _version::*; | 8 | pub use _version::*; |
| 9 | 9 | ||
| 10 | #[cfg(feature = "time")] | ||
| 10 | mod timeout; | 11 | mod timeout; |
| 12 | #[cfg(feature = "time")] | ||
| 11 | pub use timeout::*; | 13 | pub use timeout::*; |
| 12 | 14 | ||
| 13 | use crate::peripherals; | 15 | use crate::peripherals; |
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 0392e8086..bcf2feee8 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -52,7 +52,7 @@ pub mod sdmmc; | |||
| 52 | pub mod spi; | 52 | pub mod spi; |
| 53 | #[cfg(usart)] | 53 | #[cfg(usart)] |
| 54 | pub mod usart; | 54 | pub mod usart; |
| 55 | #[cfg(usb)] | 55 | #[cfg(all(usb, feature = "time"))] |
| 56 | pub mod usb; | 56 | pub mod usb; |
| 57 | #[cfg(any(otgfs, otghs))] | 57 | #[cfg(any(otgfs, otghs))] |
| 58 | pub mod usb_otg; | 58 | pub mod usb_otg; |
diff --git a/embassy-stm32/src/subghz/timeout.rs b/embassy-stm32/src/subghz/timeout.rs index 28b3b0c21..0ae49dd90 100644 --- a/embassy-stm32/src/subghz/timeout.rs +++ b/embassy-stm32/src/subghz/timeout.rs | |||
| @@ -439,6 +439,7 @@ impl From<Timeout> for [u8; 3] { | |||
| 439 | } | 439 | } |
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | #[cfg(feature = "time")] | ||
| 442 | impl From<Timeout> for embassy_time::Duration { | 443 | impl From<Timeout> for embassy_time::Duration { |
| 443 | fn from(to: Timeout) -> Self { | 444 | fn from(to: Timeout) -> Self { |
| 444 | embassy_time::Duration::from_micros(to.as_micros().into()) | 445 | embassy_time::Duration::from_micros(to.as_micros().into()) |
diff --git a/embassy-stm32/src/subghz/tx_params.rs b/embassy-stm32/src/subghz/tx_params.rs index cede6f2c1..03bdb1ea8 100644 --- a/embassy-stm32/src/subghz/tx_params.rs +++ b/embassy-stm32/src/subghz/tx_params.rs | |||
| @@ -44,6 +44,7 @@ impl From<RampTime> for core::time::Duration { | |||
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | #[cfg(feature = "time")] | ||
| 47 | impl From<RampTime> for embassy_time::Duration { | 48 | impl From<RampTime> for embassy_time::Duration { |
| 48 | fn from(rt: RampTime) -> Self { | 49 | fn from(rt: RampTime) -> Self { |
| 49 | match rt { | 50 | match rt { |
