aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-07-05 19:16:45 +0200
committerDario Nieuwenhuis <[email protected]>2023-07-05 19:20:49 +0200
commita42ac86f1b71700632b77196ad506587774ae976 (patch)
tree220cf7195f05ee8ad4b9956ac3539c6e56d7c405
parentc6cd69887c64e22575442359040a890f32719295 (diff)
Remove wifi envvars. They're annoying, they cause rust-analyzer errors when opening the examples.
-rwxr-xr-xci.sh4
-rw-r--r--cyw43/README.md2
-rw-r--r--examples/nrf52840/src/bin/wifi_esp_hosted.rs5
-rw-r--r--examples/rp/src/bin/wifi_tcp_server.rs7
4 files changed, 10 insertions, 8 deletions
diff --git a/ci.sh b/ci.sh
index a03efb856..376cc8f44 100755
--- a/ci.sh
+++ b/ci.sh
@@ -5,10 +5,6 @@ set -euo pipefail
5export RUSTFLAGS=-Dwarnings 5export RUSTFLAGS=-Dwarnings
6export DEFMT_LOG=trace,embassy_net_esp_hosted=debug,cyw43=info,cyw43_pio=info,smoltcp=info 6export DEFMT_LOG=trace,embassy_net_esp_hosted=debug,cyw43=info,cyw43_pio=info,smoltcp=info
7 7
8# needed by wifi examples
9export WIFI_NETWORK=x
10export WIFI_PASSWORD=x
11
12TARGET=$(rustc -vV | sed -n 's|host: ||p') 8TARGET=$(rustc -vV | sed -n 's|host: ||p')
13 9
14BUILD_EXTRA="" 10BUILD_EXTRA=""
diff --git a/cyw43/README.md b/cyw43/README.md
index e4a81410d..5b8f3cf40 100644
--- a/cyw43/README.md
+++ b/cyw43/README.md
@@ -30,7 +30,7 @@ TODO:
30### Example 2: Create an access point (IP and credentials in the code) 30### Example 2: Create an access point (IP and credentials in the code)
31- `cargo run --release --bin wifi_ap_tcp_server` 31- `cargo run --release --bin wifi_ap_tcp_server`
32### Example 3: Connect to an existing network and create a server 32### Example 3: Connect to an existing network and create a server
33- `WIFI_NETWORK=MyWifiNetwork WIFI_PASSWORD=MyWifiPassword cargo run --release --bin wifi_tcp_server` 33- `cargo run --release --bin wifi_tcp_server`
34 34
35After a few seconds, you should see that DHCP picks up an IP address like this 35After a few seconds, you should see that DHCP picks up an IP address like this
36``` 36```
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs
index f7496703c..112e41bcd 100644
--- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs
+++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs
@@ -16,6 +16,9 @@ use embedded_io::asynch::Write;
16use static_cell::make_static; 16use static_cell::make_static;
17use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _}; 17use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _};
18 18
19const WIFI_NETWORK: &str = "EmbassyTest";
20const WIFI_PASSWORD: &str = "V8YxhKt5CdIAJFud";
21
19bind_interrupts!(struct Irqs { 22bind_interrupts!(struct Irqs {
20 SPIM3 => spim::InterruptHandler<peripherals::SPI3>; 23 SPIM3 => spim::InterruptHandler<peripherals::SPI3>;
21 RNG => embassy_nrf::rng::InterruptHandler<peripherals::RNG>; 24 RNG => embassy_nrf::rng::InterruptHandler<peripherals::RNG>;
@@ -70,7 +73,7 @@ async fn main(spawner: Spawner) {
70 unwrap!(spawner.spawn(wifi_task(runner))); 73 unwrap!(spawner.spawn(wifi_task(runner)));
71 74
72 control.init().await; 75 control.init().await;
73 control.join(env!("WIFI_NETWORK"), env!("WIFI_PASSWORD")).await; 76 control.join(WIFI_NETWORK, WIFI_PASSWORD).await;
74 77
75 let config = embassy_net::Config::dhcpv4(Default::default()); 78 let config = embassy_net::Config::dhcpv4(Default::default());
76 // let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { 79 // let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs
index e9d1079a6..197535f45 100644
--- a/examples/rp/src/bin/wifi_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_tcp_server.rs
@@ -19,6 +19,9 @@ use embedded_io::asynch::Write;
19use static_cell::make_static; 19use static_cell::make_static;
20use {defmt_rtt as _, panic_probe as _}; 20use {defmt_rtt as _, panic_probe as _};
21 21
22const WIFI_NETWORK: &str = "EmbassyTest";
23const WIFI_PASSWORD: &str = "V8YxhKt5CdIAJFud";
24
22#[embassy_executor::task] 25#[embassy_executor::task]
23async fn wifi_task( 26async fn wifi_task(
24 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>, 27 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
@@ -82,8 +85,8 @@ async fn main(spawner: Spawner) {
82 unwrap!(spawner.spawn(net_task(stack))); 85 unwrap!(spawner.spawn(net_task(stack)));
83 86
84 loop { 87 loop {
85 //control.join_open(env!("WIFI_NETWORK")).await; 88 //control.join_open(WIFI_NETWORK).await;
86 match control.join_wpa2(env!("WIFI_NETWORK"), env!("WIFI_PASSWORD")).await { 89 match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await {
87 Ok(_) => break, 90 Ok(_) => break,
88 Err(err) => { 91 Err(err) => {
89 info!("join failed with status={}", err.status); 92 info!("join failed with status={}", err.status);