diff options
| author | kbleeke <[email protected]> | 2023-03-21 19:32:39 +0100 |
|---|---|---|
| committer | kbleeke <[email protected]> | 2023-03-21 19:32:39 +0100 |
| commit | 29494a9296552334cc9dd2359c16dfbf8f3e7efc (patch) | |
| tree | a98ff6e9fb5a0f32041ff2e850a6cfca61dba71f /examples | |
| parent | f82f931dc2b8df2338fb8331ad27d667811e5c09 (diff) | |
| parent | 0e946dfb203dcf1ca3f165ffb06f3f58d4eaa119 (diff) | |
Merge branch 'master' into pio
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rpi-pico-w/src/main.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/rpi-pico-w/src/main.rs b/examples/rpi-pico-w/src/main.rs index f30a20bac..67348e454 100644 --- a/examples/rpi-pico-w/src/main.rs +++ b/examples/rpi-pico-w/src/main.rs | |||
| @@ -59,7 +59,7 @@ async fn main(spawner: Spawner) { | |||
| 59 | // To make flashing faster for development, you may want to flash the firmwares independently | 59 | // To make flashing faster for development, you may want to flash the firmwares independently |
| 60 | // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: | 60 | // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: |
| 61 | // probe-rs-cli download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 | 61 | // probe-rs-cli download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 |
| 62 | // probe-rs-cli download 43439A0.clm_blob --format bin --chip RP2040 --base-address 0x10140000 | 62 | // probe-rs-cli download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 |
| 63 | //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; | 63 | //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; |
| 64 | //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; | 64 | //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; |
| 65 | 65 | ||
| @@ -78,16 +78,11 @@ async fn main(spawner: Spawner) { | |||
| 78 | let state = singleton!(cyw43::State::new()); | 78 | let state = singleton!(cyw43::State::new()); |
| 79 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 79 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 80 | 80 | ||
| 81 | spawner.spawn(wifi_task(runner)).unwrap(); | ||
| 82 | |||
| 83 | control.init(clm).await; | 81 | control.init(clm).await; |
| 84 | control | 82 | control |
| 85 | .set_power_management(cyw43::PowerManagementMode::PowerSave) | 83 | .set_power_management(cyw43::PowerManagementMode::PowerSave) |
| 86 | .await; | 84 | .await; |
| 87 | 85 | ||
| 88 | //control.join_open(env!("WIFI_NETWORK")).await; | ||
| 89 | control.join_wpa2(env!("WIFI_NETWORK"), env!("WIFI_PASSWORD")).await; | ||
| 90 | |||
| 91 | let config = Config::Dhcp(Default::default()); | 86 | let config = Config::Dhcp(Default::default()); |
| 92 | //let config = embassy_net::Config::Static(embassy_net::Config { | 87 | //let config = embassy_net::Config::Static(embassy_net::Config { |
| 93 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 88 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| @@ -106,8 +101,12 @@ async fn main(spawner: Spawner) { | |||
| 106 | seed | 101 | seed |
| 107 | )); | 102 | )); |
| 108 | 103 | ||
| 104 | unwrap!(spawner.spawn(wifi_task(runner))); | ||
| 109 | unwrap!(spawner.spawn(net_task(stack))); | 105 | unwrap!(spawner.spawn(net_task(stack))); |
| 110 | 106 | ||
| 107 | //control.join_open(env!("WIFI_NETWORK")).await; | ||
| 108 | control.join_wpa2(env!("WIFI_NETWORK"), env!("WIFI_PASSWORD")).await; | ||
| 109 | |||
| 111 | // And now we can use it! | 110 | // And now we can use it! |
| 112 | 111 | ||
| 113 | let mut rx_buffer = [0; 4096]; | 112 | let mut rx_buffer = [0; 4096]; |
