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-net | |
| parent | 597315873dbef394ae4cefe0af740fcb1bb951e0 (diff) | |
Reduce use of the full `futures` crate.
Diffstat (limited to 'embassy-net')
| -rw-r--r-- | embassy-net/Cargo.toml | 1 | ||||
| -rw-r--r-- | embassy-net/src/lib.rs | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index ee7289ad8..7d71e902f 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml | |||
| @@ -81,7 +81,6 @@ heapless = { version = "0.8", default-features = false } | |||
| 81 | as-slice = "0.2.1" | 81 | as-slice = "0.2.1" |
| 82 | generic-array = { version = "0.14.4", default-features = false } | 82 | generic-array = { version = "0.14.4", default-features = false } |
| 83 | stable_deref_trait = { version = "1.2.0", default-features = false } | 83 | stable_deref_trait = { version = "1.2.0", default-features = false } |
| 84 | futures = { version = "0.3.17", default-features = false, features = [ "async-await" ] } | ||
| 85 | atomic-pool = "1.0" | 84 | atomic-pool = "1.0" |
| 86 | embedded-nal-async = { version = "0.7.1" } | 85 | embedded-nal-async = { version = "0.7.1" } |
| 87 | document-features = "0.2.7" | 86 | document-features = "0.2.7" |
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 86ced1ded..12f5f30b4 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -25,13 +25,13 @@ pub mod udp; | |||
| 25 | 25 | ||
| 26 | use core::cell::RefCell; | 26 | use core::cell::RefCell; |
| 27 | use core::future::{poll_fn, Future}; | 27 | use core::future::{poll_fn, Future}; |
| 28 | use core::pin::pin; | ||
| 28 | use core::task::{Context, Poll}; | 29 | use core::task::{Context, Poll}; |
| 29 | 30 | ||
| 30 | pub use embassy_net_driver as driver; | 31 | pub use embassy_net_driver as driver; |
| 31 | use embassy_net_driver::{Driver, LinkState}; | 32 | use embassy_net_driver::{Driver, LinkState}; |
| 32 | use embassy_sync::waitqueue::WakerRegistration; | 33 | use embassy_sync::waitqueue::WakerRegistration; |
| 33 | use embassy_time::{Instant, Timer}; | 34 | use embassy_time::{Instant, Timer}; |
| 34 | use futures::pin_mut; | ||
| 35 | #[allow(unused_imports)] | 35 | #[allow(unused_imports)] |
| 36 | use heapless::Vec; | 36 | use heapless::Vec; |
| 37 | #[cfg(feature = "igmp")] | 37 | #[cfg(feature = "igmp")] |
| @@ -905,8 +905,7 @@ impl<D: Driver> Inner<D> { | |||
| 905 | } | 905 | } |
| 906 | 906 | ||
| 907 | if let Some(poll_at) = s.iface.poll_at(timestamp, &mut s.sockets) { | 907 | if let Some(poll_at) = s.iface.poll_at(timestamp, &mut s.sockets) { |
| 908 | let t = Timer::at(instant_from_smoltcp(poll_at)); | 908 | let t = pin!(Timer::at(instant_from_smoltcp(poll_at))); |
| 909 | pin_mut!(t); | ||
| 910 | if t.poll(cx).is_ready() { | 909 | if t.poll(cx).is_ready() { |
| 911 | cx.waker().wake_by_ref(); | 910 | cx.waker().wake_by_ref(); |
| 912 | } | 911 | } |
