Skip to content

Commit

Permalink
riot-rs-embassy: introduce & use wifi feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Mar 11, 2024
1 parent 5b8b0f5 commit 0928cd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/riot-rs-embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ usb = ["dep:embassy-usb"]
net = ["dep:embassy-net"]
usb-ethernet = ["usb", "net"]

wifi-esp = ["dep:esp-wifi", "dep:embassy-net-driver-channel", "net"]
wifi-cyw43 = ["dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net"]
wifi = []
wifi-esp = ["dep:esp-wifi", "dep:embassy-net-driver-channel", "net", "wifi"]
wifi-cyw43 = ["dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net", "wifi"]

threading = ["dep:riot-rs-core"]
override-network-config = []
Expand Down
9 changes: 3 additions & 6 deletions src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod usb;
#[cfg(feature = "net")]
pub mod network;

#[cfg(any(feature = "wifi-cyw43", feature = "wifi-esp"))]
#[cfg(feature = "wifi")]
mod wifi;

// re-exports
Expand All @@ -33,11 +33,8 @@ pub use embassy_executor::Spawner;
#[cfg(feature = "usb-ethernet")]
use usb::ethernet::NetworkDevice;

#[cfg(feature = "wifi-cyw43")]
use wifi::cyw43::NetworkDevice;

#[cfg(feature = "wifi-esp")]
use wifi::esp_wifi::NetworkDevice;
#[cfg(feature = "wifi")]
use wifi::NetworkDevice;

#[cfg(feature = "net")]
pub use network::NetworkStack;
Expand Down
6 changes: 6 additions & 0 deletions src/riot-rs-embassy/src/wifi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ pub mod cyw43;
#[cfg(feature = "wifi-esp")]
pub mod esp_wifi;

#[cfg(feature = "wifi-cyw43")]
pub(crate) use cyw43::NetworkDevice;

#[cfg(feature = "wifi-esp")]
pub(crate) use esp_wifi::NetworkDevice;

use riot_rs_utils::str_from_env_or;

pub(crate) const WIFI_NETWORK: &str = str_from_env_or!(
Expand Down

0 comments on commit 0928cd1

Please sign in to comment.