diff --git a/esp-wifi/Cargo.toml b/esp-wifi/Cargo.toml index a03485e7149..0ff68b38a53 100644 --- a/esp-wifi/Cargo.toml +++ b/esp-wifi/Cargo.toml @@ -45,14 +45,13 @@ num-traits = { workspace = true, default-features = false } esp-wifi-sys = { version = "0.1.0", path = "../esp-wifi-sys" } embassy-sync = { workspace = true, optional = true } embassy-futures = { workspace = true, optional = true } -embassy-net = { workspace = true, optional = true } +embassy-net-driver = { workspace = true, optional = true } toml-cfg.workspace = true libm.workspace = true cfg-if.workspace = true portable-atomic.workspace = true portable_atomic_enum.workspace = true -# We don't use these directly but we need to enable portable-atomic on them futures-util.workspace = true atomic-waker.workspace = true @@ -64,6 +63,7 @@ esp-println = { workspace = true, features = ["log"] } esp-backtrace.workspace = true embassy-executor.workspace = true embassy-time.workspace = true +embassy-net.workspace = true bleps = { workspace = true, features = ["async"] } embedded-hal-async.workspace = true log.workspace = true @@ -102,7 +102,7 @@ async = [ "esp32s3-hal?/async", ] -embassy-net = ["dep:embassy-net", "async"] +embassy-net = ["dep:embassy-net-driver", "async"] # misc features coex = [] diff --git a/esp-wifi/src/lib.rs b/esp-wifi/src/lib.rs index 9a4eb0e9b0e..32133670471 100644 --- a/esp-wifi/src/lib.rs +++ b/esp-wifi/src/lib.rs @@ -2,7 +2,6 @@ #![cfg_attr(target_arch = "xtensa", feature(asm_experimental_arch))] #![feature(c_variadic)] #![feature(linkage)] -#![cfg_attr(feature = "async", feature(async_fn_in_trait))] #![cfg_attr(feature = "async", allow(incomplete_features))] #![doc = include_str!("../README.md")] #![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")] diff --git a/esp-wifi/src/wifi/mod.rs b/esp-wifi/src/wifi/mod.rs index 60667094276..ed84c7a809d 100644 --- a/esp-wifi/src/wifi/mod.rs +++ b/esp-wifi/src/wifi/mod.rs @@ -1086,7 +1086,7 @@ mod sealed { fn register_link_state_waker(self, cx: &mut core::task::Context); #[cfg(feature = "embassy-net")] - fn link_state(self) -> embassy_net::driver::LinkState; + fn link_state(self) -> embassy_net_driver::LinkState; } impl Sealed for WifiStaDevice { @@ -1122,11 +1122,11 @@ mod sealed { } #[cfg(feature = "embassy-net")] - fn link_state(self) -> embassy_net::driver::LinkState { + fn link_state(self) -> embassy_net_driver::LinkState { if matches!(get_sta_state(), WifiState::StaConnected) { - embassy_net::driver::LinkState::Up + embassy_net_driver::LinkState::Up } else { - embassy_net::driver::LinkState::Down + embassy_net_driver::LinkState::Down } } } @@ -1164,11 +1164,11 @@ mod sealed { } #[cfg(feature = "embassy-net")] - fn link_state(self) -> embassy_net::driver::LinkState { + fn link_state(self) -> embassy_net_driver::LinkState { if matches!(get_ap_state(), WifiState::ApStarted) { - embassy_net::driver::LinkState::Up + embassy_net_driver::LinkState::Up } else { - embassy_net::driver::LinkState::Down + embassy_net_driver::LinkState::Down } } } @@ -1738,7 +1738,7 @@ macro_rules! esp_wifi_result { #[cfg(feature = "embassy-net")] pub(crate) mod embassy { use super::*; - use embassy_net::driver::{Capabilities, Driver, HardwareAddress, RxToken, TxToken}; + use embassy_net_driver::{Capabilities, Driver, HardwareAddress, RxToken, TxToken}; use embassy_sync::waitqueue::AtomicWaker; // We can get away with a single tx waker because the transmit queue is shared @@ -1787,7 +1787,7 @@ pub(crate) mod embassy { self.mode.tx_token() } - fn link_state(&mut self, cx: &mut core::task::Context) -> embassy_net::driver::LinkState { + fn link_state(&mut self, cx: &mut core::task::Context) -> embassy_net_driver::LinkState { self.mode.register_link_state_waker(cx); self.mode.link_state() }