aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-10-02 20:07:45 +0000
committerGitHub <[email protected]>2023-10-02 20:07:45 +0000
commita742a80171508b33988095c23f64d4d58d087fbb (patch)
tree22b4a61e65b9c4ff46be7399686fc99114de7f41
parent9228a6334ba7631e1dcd436b3a5676fe966064cf (diff)
parent90ade1b311646f0ed83f3f2264537bccca2258d5 (diff)
Merge pull request #1999 from KingCol13/rp-wifi-examples-fixes
cyw43: Update examples
-rw-r--r--examples/rp/src/bin/wifi_ap_tcp_server.rs2
-rw-r--r--examples/rp/src/bin/wifi_blinky.rs2
-rw-r--r--examples/rp/src/bin/wifi_scan.rs2
-rw-r--r--examples/rp/src/bin/wifi_tcp_server.rs11
4 files changed, 12 insertions, 5 deletions
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs
index cd61ad789..98cae53f6 100644
--- a/examples/rp/src/bin/wifi_ap_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs
@@ -52,7 +52,7 @@ async fn main(spawner: Spawner) {
52 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: 52 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`:
53 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 53 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000
54 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 54 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000
55 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; 55 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 230321) };
56 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; 56 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) };
57 57
58 let pwr = Output::new(p.PIN_23, Level::Low); 58 let pwr = Output::new(p.PIN_23, Level::Low);
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs
index 33d43788c..14ace74e9 100644
--- a/examples/rp/src/bin/wifi_blinky.rs
+++ b/examples/rp/src/bin/wifi_blinky.rs
@@ -38,7 +38,7 @@ async fn main(spawner: Spawner) {
38 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: 38 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`:
39 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 39 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000
40 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 40 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000
41 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; 41 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 230321) };
42 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; 42 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) };
43 43
44 let pwr = Output::new(p.PIN_23, Level::Low); 44 let pwr = Output::new(p.PIN_23, Level::Low);
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs
index 743fab617..dbbbf6c81 100644
--- a/examples/rp/src/bin/wifi_scan.rs
+++ b/examples/rp/src/bin/wifi_scan.rs
@@ -49,7 +49,7 @@ async fn main(spawner: Spawner) {
49 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: 49 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`:
50 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 50 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000
51 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 51 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000
52 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; 52 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 230321) };
53 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; 53 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) };
54 54
55 let pwr = Output::new(p.PIN_23, Level::Low); 55 let pwr = Output::new(p.PIN_23, Level::Low);
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs
index 55fcb4a6a..64cf95171 100644
--- a/examples/rp/src/bin/wifi_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_tcp_server.rs
@@ -18,7 +18,7 @@ use embassy_rp::bind_interrupts;
18use embassy_rp::gpio::{Level, Output}; 18use embassy_rp::gpio::{Level, Output};
19use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 19use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
20use embassy_rp::pio::{InterruptHandler, Pio}; 20use embassy_rp::pio::{InterruptHandler, Pio};
21use embassy_time::Duration; 21use embassy_time::{Duration, Timer};
22use embedded_io_async::Write; 22use embedded_io_async::Write;
23use static_cell::make_static; 23use static_cell::make_static;
24use {defmt_rtt as _, panic_probe as _}; 24use {defmt_rtt as _, panic_probe as _};
@@ -55,7 +55,7 @@ async fn main(spawner: Spawner) {
55 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: 55 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`:
56 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 56 // probe-rs download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000
57 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 57 // probe-rs download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000
58 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; 58 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 230321) };
59 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; 59 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) };
60 60
61 let pwr = Output::new(p.PIN_23, Level::Low); 61 let pwr = Output::new(p.PIN_23, Level::Low);
@@ -102,6 +102,13 @@ async fn main(spawner: Spawner) {
102 } 102 }
103 } 103 }
104 104
105 // Wait for DHCP, not necessary when using static IP
106 info!("waiting for DHCP...");
107 while !stack.is_config_up() {
108 Timer::after(Duration::from_millis(100)).await;
109 }
110 info!("DHCP is now up!");
111
105 // And now we can use it! 112 // And now we can use it!
106 113
107 let mut rx_buffer = [0; 4096]; 114 let mut rx_buffer = [0; 4096];