diff options
Diffstat (limited to 'examples/rp/src')
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_multisocket.rs | 8 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_client.rs | 8 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_server.rs | 9 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_udp.rs | 9 | ||||
| -rw-r--r-- | examples/rp/src/bin/flash.rs | 34 | ||||
| -rw-r--r-- | examples/rp/src/bin/lora_p2p_send_multicore.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/multicore.rs | 2 |
7 files changed, 41 insertions, 31 deletions
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index 9f800d0d9..c0fde62ab 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -10,13 +10,14 @@ use defmt::*; | |||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_futures::yield_now; | 11 | use embassy_futures::yield_now; |
| 12 | use embassy_net::{Stack, StackResources}; | 12 | use embassy_net::{Stack, StackResources}; |
| 13 | use embassy_net_w5500::*; | 13 | use embassy_net_wiznet::chip::W5500; |
| 14 | use embassy_net_wiznet::*; | ||
| 14 | use embassy_rp::clocks::RoscRng; | 15 | use embassy_rp::clocks::RoscRng; |
| 15 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 16 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| 17 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | 18 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; |
| 18 | use embassy_time::{Delay, Duration}; | 19 | use embassy_time::{Delay, Duration}; |
| 19 | use embedded_hal_async::spi::ExclusiveDevice; | 20 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 20 | use embedded_io_async::Write; | 21 | use embedded_io_async::Write; |
| 21 | use rand::RngCore; | 22 | use rand::RngCore; |
| 22 | use static_cell::make_static; | 23 | use static_cell::make_static; |
| @@ -26,6 +27,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 26 | async fn ethernet_task( | 27 | async fn ethernet_task( |
| 27 | runner: Runner< | 28 | runner: Runner< |
| 28 | 'static, | 29 | 'static, |
| 30 | W5500, | ||
| 29 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 30 | Input<'static, PIN_21>, | 32 | Input<'static, PIN_21>, |
| 31 | Output<'static, PIN_20>, | 33 | Output<'static, PIN_20>, |
| @@ -54,7 +56,7 @@ async fn main(spawner: Spawner) { | |||
| 54 | 56 | ||
| 55 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 56 | let state = make_static!(State::<8, 8>::new()); | 58 | let state = make_static!(State::<8, 8>::new()); |
| 57 | let (device, runner) = embassy_net_w5500::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 58 | mac_addr, | 60 | mac_addr, |
| 59 | state, | 61 | state, |
| 60 | ExclusiveDevice::new(spi, cs, Delay), | 62 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index fee84b613..e593acae4 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -12,13 +12,14 @@ use defmt::*; | |||
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_futures::yield_now; | 13 | use embassy_futures::yield_now; |
| 14 | use embassy_net::{Stack, StackResources}; | 14 | use embassy_net::{Stack, StackResources}; |
| 15 | use embassy_net_w5500::*; | 15 | use embassy_net_wiznet::chip::W5500; |
| 16 | use embassy_net_wiznet::*; | ||
| 16 | use embassy_rp::clocks::RoscRng; | 17 | use embassy_rp::clocks::RoscRng; |
| 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 18 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 19 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| 19 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | 20 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; |
| 20 | use embassy_time::{Delay, Duration, Timer}; | 21 | use embassy_time::{Delay, Duration, Timer}; |
| 21 | use embedded_hal_async::spi::ExclusiveDevice; | 22 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 22 | use embedded_io_async::Write; | 23 | use embedded_io_async::Write; |
| 23 | use rand::RngCore; | 24 | use rand::RngCore; |
| 24 | use static_cell::make_static; | 25 | use static_cell::make_static; |
| @@ -28,6 +29,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 28 | async fn ethernet_task( | 29 | async fn ethernet_task( |
| 29 | runner: Runner< | 30 | runner: Runner< |
| 30 | 'static, | 31 | 'static, |
| 32 | W5500, | ||
| 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 33 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 32 | Input<'static, PIN_21>, | 34 | Input<'static, PIN_21>, |
| 33 | Output<'static, PIN_20>, | 35 | Output<'static, PIN_20>, |
| @@ -57,7 +59,7 @@ async fn main(spawner: Spawner) { | |||
| 57 | 59 | ||
| 58 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 60 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 59 | let state = make_static!(State::<8, 8>::new()); | 61 | let state = make_static!(State::<8, 8>::new()); |
| 60 | let (device, runner) = embassy_net_w5500::new( | 62 | let (device, runner) = embassy_net_wiznet::new( |
| 61 | mac_addr, | 63 | mac_addr, |
| 62 | state, | 64 | state, |
| 63 | ExclusiveDevice::new(spi, cs, Delay), | 65 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 024574267..c62caed7a 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -11,21 +11,24 @@ use defmt::*; | |||
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_futures::yield_now; | 12 | use embassy_futures::yield_now; |
| 13 | use embassy_net::{Stack, StackResources}; | 13 | use embassy_net::{Stack, StackResources}; |
| 14 | use embassy_net_w5500::*; | 14 | use embassy_net_wiznet::chip::W5500; |
| 15 | use embassy_net_wiznet::*; | ||
| 15 | use embassy_rp::clocks::RoscRng; | 16 | use embassy_rp::clocks::RoscRng; |
| 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| 18 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | 19 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; |
| 19 | use embassy_time::{Delay, Duration}; | 20 | use embassy_time::{Delay, Duration}; |
| 20 | use embedded_hal_async::spi::ExclusiveDevice; | 21 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 21 | use embedded_io_async::Write; | 22 | use embedded_io_async::Write; |
| 22 | use rand::RngCore; | 23 | use rand::RngCore; |
| 23 | use static_cell::make_static; | 24 | use static_cell::make_static; |
| 24 | use {defmt_rtt as _, panic_probe as _}; | 25 | use {defmt_rtt as _, panic_probe as _}; |
| 26 | |||
| 25 | #[embassy_executor::task] | 27 | #[embassy_executor::task] |
| 26 | async fn ethernet_task( | 28 | async fn ethernet_task( |
| 27 | runner: Runner< | 29 | runner: Runner< |
| 28 | 'static, | 30 | 'static, |
| 31 | W5500, | ||
| 29 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 32 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 30 | Input<'static, PIN_21>, | 33 | Input<'static, PIN_21>, |
| 31 | Output<'static, PIN_20>, | 34 | Output<'static, PIN_20>, |
| @@ -55,7 +58,7 @@ async fn main(spawner: Spawner) { | |||
| 55 | 58 | ||
| 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 59 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 57 | let state = make_static!(State::<8, 8>::new()); | 60 | let state = make_static!(State::<8, 8>::new()); |
| 58 | let (device, runner) = embassy_net_w5500::new( | 61 | let (device, runner) = embassy_net_wiznet::new( |
| 59 | mac_addr, | 62 | mac_addr, |
| 60 | state, | 63 | state, |
| 61 | ExclusiveDevice::new(spi, cs, Delay), | 64 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index 038432b17..76dabce1c 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -11,20 +11,23 @@ use embassy_executor::Spawner; | |||
| 11 | use embassy_futures::yield_now; | 11 | use embassy_futures::yield_now; |
| 12 | use embassy_net::udp::{PacketMetadata, UdpSocket}; | 12 | use embassy_net::udp::{PacketMetadata, UdpSocket}; |
| 13 | use embassy_net::{Stack, StackResources}; | 13 | use embassy_net::{Stack, StackResources}; |
| 14 | use embassy_net_w5500::*; | 14 | use embassy_net_wiznet::chip::W5500; |
| 15 | use embassy_net_wiznet::*; | ||
| 15 | use embassy_rp::clocks::RoscRng; | 16 | use embassy_rp::clocks::RoscRng; |
| 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| 18 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | 19 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; |
| 19 | use embassy_time::Delay; | 20 | use embassy_time::Delay; |
| 20 | use embedded_hal_async::spi::ExclusiveDevice; | 21 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 21 | use rand::RngCore; | 22 | use rand::RngCore; |
| 22 | use static_cell::make_static; | 23 | use static_cell::make_static; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 24 | use {defmt_rtt as _, panic_probe as _}; |
| 25 | |||
| 24 | #[embassy_executor::task] | 26 | #[embassy_executor::task] |
| 25 | async fn ethernet_task( | 27 | async fn ethernet_task( |
| 26 | runner: Runner< | 28 | runner: Runner< |
| 27 | 'static, | 29 | 'static, |
| 30 | W5500, | ||
| 28 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 29 | Input<'static, PIN_21>, | 32 | Input<'static, PIN_21>, |
| 30 | Output<'static, PIN_20>, | 33 | Output<'static, PIN_20>, |
| @@ -53,7 +56,7 @@ async fn main(spawner: Spawner) { | |||
| 53 | 56 | ||
| 54 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 55 | let state = make_static!(State::<8, 8>::new()); | 58 | let state = make_static!(State::<8, 8>::new()); |
| 56 | let (device, runner) = embassy_net_w5500::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 57 | mac_addr, | 60 | mac_addr, |
| 58 | state, | 61 | state, |
| 59 | ExclusiveDevice::new(spi, cs, Delay), | 62 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/flash.rs b/examples/rp/src/bin/flash.rs index 88bb931d2..911a657eb 100644 --- a/examples/rp/src/bin/flash.rs +++ b/examples/rp/src/bin/flash.rs | |||
| @@ -28,12 +28,12 @@ async fn main(_spawner: Spawner) { | |||
| 28 | let mut flash = embassy_rp::flash::Flash::<_, Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH0); | 28 | let mut flash = embassy_rp::flash::Flash::<_, Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH0); |
| 29 | 29 | ||
| 30 | // Get JEDEC id | 30 | // Get JEDEC id |
| 31 | let jedec = flash.jedec_id().unwrap(); | 31 | let jedec = flash.blocking_jedec_id().unwrap(); |
| 32 | info!("jedec id: 0x{:x}", jedec); | 32 | info!("jedec id: 0x{:x}", jedec); |
| 33 | 33 | ||
| 34 | // Get unique id | 34 | // Get unique id |
| 35 | let mut uid = [0; 8]; | 35 | let mut uid = [0; 8]; |
| 36 | flash.unique_id(&mut uid).unwrap(); | 36 | flash.blocking_unique_id(&mut uid).unwrap(); |
| 37 | info!("unique id: {:?}", uid); | 37 | info!("unique id: {:?}", uid); |
| 38 | 38 | ||
| 39 | erase_write_sector(&mut flash, 0x00); | 39 | erase_write_sector(&mut flash, 0x00); |
| @@ -48,25 +48,25 @@ async fn main(_spawner: Spawner) { | |||
| 48 | fn multiwrite_bytes(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLASH_SIZE>, offset: u32) { | 48 | fn multiwrite_bytes(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLASH_SIZE>, offset: u32) { |
| 49 | info!(">>>> [multiwrite_bytes]"); | 49 | info!(">>>> [multiwrite_bytes]"); |
| 50 | let mut read_buf = [0u8; ERASE_SIZE]; | 50 | let mut read_buf = [0u8; ERASE_SIZE]; |
| 51 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut read_buf)); | 51 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut read_buf)); |
| 52 | 52 | ||
| 53 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); | 53 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); |
| 54 | info!("Contents start with {=[u8]}", read_buf[0..4]); | 54 | info!("Contents start with {=[u8]}", read_buf[0..4]); |
| 55 | 55 | ||
| 56 | defmt::unwrap!(flash.erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); | 56 | defmt::unwrap!(flash.blocking_erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); |
| 57 | 57 | ||
| 58 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut read_buf)); | 58 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut read_buf)); |
| 59 | info!("Contents after erase starts with {=[u8]}", read_buf[0..4]); | 59 | info!("Contents after erase starts with {=[u8]}", read_buf[0..4]); |
| 60 | if read_buf.iter().any(|x| *x != 0xFF) { | 60 | if read_buf.iter().any(|x| *x != 0xFF) { |
| 61 | defmt::panic!("unexpected"); | 61 | defmt::panic!("unexpected"); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset, &[0x01])); | 64 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset, &[0x01])); |
| 65 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset + 1, &[0x02])); | 65 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset + 1, &[0x02])); |
| 66 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset + 2, &[0x03])); | 66 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset + 2, &[0x03])); |
| 67 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset + 3, &[0x04])); | 67 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset + 3, &[0x04])); |
| 68 | 68 | ||
| 69 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut read_buf)); | 69 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut read_buf)); |
| 70 | info!("Contents after write starts with {=[u8]}", read_buf[0..4]); | 70 | info!("Contents after write starts with {=[u8]}", read_buf[0..4]); |
| 71 | if &read_buf[0..4] != &[0x01, 0x02, 0x03, 0x04] { | 71 | if &read_buf[0..4] != &[0x01, 0x02, 0x03, 0x04] { |
| 72 | defmt::panic!("unexpected"); | 72 | defmt::panic!("unexpected"); |
| @@ -76,14 +76,14 @@ fn multiwrite_bytes(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLASH | |||
| 76 | fn erase_write_sector(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLASH_SIZE>, offset: u32) { | 76 | fn erase_write_sector(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLASH_SIZE>, offset: u32) { |
| 77 | info!(">>>> [erase_write_sector]"); | 77 | info!(">>>> [erase_write_sector]"); |
| 78 | let mut buf = [0u8; ERASE_SIZE]; | 78 | let mut buf = [0u8; ERASE_SIZE]; |
| 79 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut buf)); | 79 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut buf)); |
| 80 | 80 | ||
| 81 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); | 81 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); |
| 82 | info!("Contents start with {=[u8]}", buf[0..4]); | 82 | info!("Contents start with {=[u8]}", buf[0..4]); |
| 83 | 83 | ||
| 84 | defmt::unwrap!(flash.erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); | 84 | defmt::unwrap!(flash.blocking_erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); |
| 85 | 85 | ||
| 86 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut buf)); | 86 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut buf)); |
| 87 | info!("Contents after erase starts with {=[u8]}", buf[0..4]); | 87 | info!("Contents after erase starts with {=[u8]}", buf[0..4]); |
| 88 | if buf.iter().any(|x| *x != 0xFF) { | 88 | if buf.iter().any(|x| *x != 0xFF) { |
| 89 | defmt::panic!("unexpected"); | 89 | defmt::panic!("unexpected"); |
| @@ -93,9 +93,9 @@ fn erase_write_sector(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, FLA | |||
| 93 | *b = 0xDA; | 93 | *b = 0xDA; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset, &buf)); | 96 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset, &buf)); |
| 97 | 97 | ||
| 98 | defmt::unwrap!(flash.read(ADDR_OFFSET + offset, &mut buf)); | 98 | defmt::unwrap!(flash.blocking_read(ADDR_OFFSET + offset, &mut buf)); |
| 99 | info!("Contents after write starts with {=[u8]}", buf[0..4]); | 99 | info!("Contents after write starts with {=[u8]}", buf[0..4]); |
| 100 | if buf.iter().any(|x| *x != 0xDA) { | 100 | if buf.iter().any(|x| *x != 0xDA) { |
| 101 | defmt::panic!("unexpected"); | 101 | defmt::panic!("unexpected"); |
| @@ -111,7 +111,7 @@ async fn background_read(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, | |||
| 111 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); | 111 | info!("Addr of flash block is {:x}", ADDR_OFFSET + offset + FLASH_BASE as u32); |
| 112 | info!("Contents start with {=u32:x}", buf[0]); | 112 | info!("Contents start with {=u32:x}", buf[0]); |
| 113 | 113 | ||
| 114 | defmt::unwrap!(flash.erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); | 114 | defmt::unwrap!(flash.blocking_erase(ADDR_OFFSET + offset, ADDR_OFFSET + offset + ERASE_SIZE as u32)); |
| 115 | 115 | ||
| 116 | defmt::unwrap!(flash.background_read(ADDR_OFFSET + offset, &mut buf)).await; | 116 | defmt::unwrap!(flash.background_read(ADDR_OFFSET + offset, &mut buf)).await; |
| 117 | info!("Contents after erase starts with {=u32:x}", buf[0]); | 117 | info!("Contents after erase starts with {=u32:x}", buf[0]); |
| @@ -123,7 +123,7 @@ async fn background_read(flash: &mut embassy_rp::flash::Flash<'_, FLASH, Async, | |||
| 123 | *b = 0xDABA1234; | 123 | *b = 0xDABA1234; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | defmt::unwrap!(flash.write(ADDR_OFFSET + offset, unsafe { | 126 | defmt::unwrap!(flash.blocking_write(ADDR_OFFSET + offset, unsafe { |
| 127 | core::slice::from_raw_parts(buf.as_ptr() as *const u8, buf.len() * 4) | 127 | core::slice::from_raw_parts(buf.as_ptr() as *const u8, buf.len() * 4) |
| 128 | })); | 128 | })); |
| 129 | 129 | ||
diff --git a/examples/rp/src/bin/lora_p2p_send_multicore.rs b/examples/rp/src/bin/lora_p2p_send_multicore.rs index 89a62818d..b54cc92f6 100644 --- a/examples/rp/src/bin/lora_p2p_send_multicore.rs +++ b/examples/rp/src/bin/lora_p2p_send_multicore.rs | |||
| @@ -113,7 +113,7 @@ async fn core1_task( | |||
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | loop { | 115 | loop { |
| 116 | let buffer: [u8; 3] = CHANNEL.recv().await; | 116 | let buffer: [u8; 3] = CHANNEL.receive().await; |
| 117 | match lora.prepare_for_tx(&mdltn_params, 20, false).await { | 117 | match lora.prepare_for_tx(&mdltn_params, 20, false).await { |
| 118 | Ok(()) => {} | 118 | Ok(()) => {} |
| 119 | Err(err) => { | 119 | Err(err) => { |
diff --git a/examples/rp/src/bin/multicore.rs b/examples/rp/src/bin/multicore.rs index 893b724bf..bf017f6a7 100644 --- a/examples/rp/src/bin/multicore.rs +++ b/examples/rp/src/bin/multicore.rs | |||
| @@ -56,7 +56,7 @@ async fn core0_task() { | |||
| 56 | async fn core1_task(mut led: Output<'static, PIN_25>) { | 56 | async fn core1_task(mut led: Output<'static, PIN_25>) { |
| 57 | info!("Hello from core 1"); | 57 | info!("Hello from core 1"); |
| 58 | loop { | 58 | loop { |
| 59 | match CHANNEL.recv().await { | 59 | match CHANNEL.receive().await { |
| 60 | LedState::On => led.set_high(), | 60 | LedState::On => led.set_high(), |
| 61 | LedState::Off => led.set_low(), | 61 | LedState::Off => led.set_low(), |
| 62 | } | 62 | } |
