diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-04-26 23:18:28 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-04-26 23:22:25 +0200 |
| commit | 5732ee7ca975c0dd1afa83ade1667a2599d20985 (patch) | |
| tree | f627117733d3fcd5bbb4eb664559c387a8e81f33 /embassy-stm32 | |
| parent | 597315873dbef394ae4cefe0af740fcb1bb951e0 (diff) | |
Reduce use of the full `futures` crate.
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/generic_smi.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/f4.rs | 3 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/ringbuffered.rs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index da8978599..669e6537a 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -67,7 +67,7 @@ defmt = { version = "0.3", optional = true } | |||
| 67 | log = { version = "0.4.14", optional = true } | 67 | log = { version = "0.4.14", optional = true } |
| 68 | cortex-m-rt = ">=0.6.15,<0.8" | 68 | cortex-m-rt = ">=0.6.15,<0.8" |
| 69 | cortex-m = "0.7.6" | 69 | cortex-m = "0.7.6" |
| 70 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 70 | futures-util = { version = "0.3.30", default-features = false } |
| 71 | rand_core = "0.6.3" | 71 | rand_core = "0.6.3" |
| 72 | sdio-host = "0.5.0" | 72 | sdio-host = "0.5.0" |
| 73 | critical-section = "1.1" | 73 | critical-section = "1.1" |
diff --git a/embassy-stm32/src/eth/generic_smi.rs b/embassy-stm32/src/eth/generic_smi.rs index 9c26e90f1..3b43051f4 100644 --- a/embassy-stm32/src/eth/generic_smi.rs +++ b/embassy-stm32/src/eth/generic_smi.rs | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | //! Generic SMI Ethernet PHY | 1 | //! Generic SMI Ethernet PHY |
| 2 | 2 | ||
| 3 | use core::task::Context; | ||
| 4 | |||
| 3 | #[cfg(feature = "time")] | 5 | #[cfg(feature = "time")] |
| 4 | use embassy_time::{Duration, Timer}; | 6 | use embassy_time::{Duration, Timer}; |
| 5 | use futures::task::Context; | ||
| 6 | #[cfg(feature = "time")] | 7 | #[cfg(feature = "time")] |
| 7 | use futures::FutureExt; | 8 | use futures_util::FutureExt; |
| 8 | 9 | ||
| 9 | use super::{StationManagement, PHY}; | 10 | use super::{StationManagement, PHY}; |
| 10 | 11 | ||
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs index 90f13ff29..2634fba37 100644 --- a/embassy-stm32/src/flash/f4.rs +++ b/embassy-stm32/src/flash/f4.rs | |||
| @@ -338,10 +338,9 @@ pub(crate) fn clear_all_err() { | |||
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | pub(crate) async fn wait_ready() -> Result<(), Error> { | 340 | pub(crate) async fn wait_ready() -> Result<(), Error> { |
| 341 | use core::future::poll_fn; | ||
| 341 | use core::task::Poll; | 342 | use core::task::Poll; |
| 342 | 343 | ||
| 343 | use futures::future::poll_fn; | ||
| 344 | |||
| 345 | poll_fn(|cx| { | 344 | poll_fn(|cx| { |
| 346 | WAKER.register(cx.waker()); | 345 | WAKER.register(cx.waker()); |
| 347 | 346 | ||
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index ccbea9831..6931beac7 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -191,7 +191,7 @@ impl Timeout { | |||
| 191 | fn with<R>(self, fut: impl Future<Output = Result<R, Error>>) -> impl Future<Output = Result<R, Error>> { | 191 | fn with<R>(self, fut: impl Future<Output = Result<R, Error>>) -> impl Future<Output = Result<R, Error>> { |
| 192 | #[cfg(feature = "time")] | 192 | #[cfg(feature = "time")] |
| 193 | { | 193 | { |
| 194 | use futures::FutureExt; | 194 | use futures_util::FutureExt; |
| 195 | 195 | ||
| 196 | embassy_futures::select::select(embassy_time::Timer::at(self.deadline), fut).map(|r| match r { | 196 | embassy_futures::select::select(embassy_time::Timer::at(self.deadline), fut).map(|r| match r { |
| 197 | embassy_futures::select::Either::First(_) => Err(Error::Timeout), | 197 | embassy_futures::select::Either::First(_) => Err(Error::Timeout), |
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 169db1b5b..c00317983 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -11,7 +11,7 @@ use embassy_embedded_hal::SetConfig; | |||
| 11 | use embassy_hal_internal::drop::OnDrop; | 11 | use embassy_hal_internal::drop::OnDrop; |
| 12 | use embassy_hal_internal::PeripheralRef; | 12 | use embassy_hal_internal::PeripheralRef; |
| 13 | use embassy_sync::waitqueue::AtomicWaker; | 13 | use embassy_sync::waitqueue::AtomicWaker; |
| 14 | use futures::future::{select, Either}; | 14 | use futures_util::future::{select, Either}; |
| 15 | 15 | ||
| 16 | use crate::dma::ChannelAndRequest; | 16 | use crate::dma::ChannelAndRequest; |
| 17 | use crate::gpio::{AFType, AnyPin, SealedPin}; | 17 | use crate::gpio::{AFType, AnyPin, SealedPin}; |
diff --git a/embassy-stm32/src/usart/ringbuffered.rs b/embassy-stm32/src/usart/ringbuffered.rs index 8eb18fe5b..7ab6cbda7 100644 --- a/embassy-stm32/src/usart/ringbuffered.rs +++ b/embassy-stm32/src/usart/ringbuffered.rs | |||
| @@ -5,7 +5,7 @@ use core::sync::atomic::{compiler_fence, Ordering}; | |||
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_embedded_hal::SetConfig; | 7 | use embassy_embedded_hal::SetConfig; |
| 8 | use futures::future::{select, Either}; | 8 | use futures_util::future::{select, Either}; |
| 9 | 9 | ||
| 10 | use super::{clear_interrupt_flags, rdr, reconfigure, sr, BasicInstance, Config, ConfigError, Error, UartRx}; | 10 | use super::{clear_interrupt_flags, rdr, reconfigure, sr, BasicInstance, Config, ConfigError, Error, UartRx}; |
| 11 | use crate::dma::ReadableRingBuffer; | 11 | use crate::dma::ReadableRingBuffer; |
