From 8938d928f8c3920a5777b0537d5d9ab3fec94586 Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Thu, 25 May 2023 22:36:56 +0200 Subject: [PATCH] Fix examples --- examples/stm32f3/src/bin/flash.rs | 10 +++++----- examples/stm32f4/src/bin/flash.rs | 4 ++-- examples/stm32f7/src/bin/flash.rs | 10 +++++----- examples/stm32h7/src/bin/flash.rs | 10 +++++----- examples/stm32l0/src/bin/flash.rs | 10 +++++----- examples/stm32l1/src/bin/flash.rs | 10 +++++----- examples/stm32wl/src/bin/flash.rs | 10 +++++----- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/examples/stm32f3/src/bin/flash.rs b/examples/stm32f3/src/bin/flash.rs index 2432a29d..236fb36c 100644 --- a/examples/stm32f3/src/bin/flash.rs +++ b/examples/stm32f3/src/bin/flash.rs @@ -18,23 +18,23 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 2048)); + unwrap!(f.blocking_erase(ADDR, ADDR + 2048)); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); + unwrap!(f.blocking_write(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!(&buf[..], &[1, 2, 3, 4, 5, 6, 7, 8]); } diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs index cadb0129..4a77595c 100644 --- a/examples/stm32f4/src/bin/flash.rs +++ b/examples/stm32f4/src/bin/flash.rs @@ -35,7 +35,7 @@ fn test_flash(f: &mut Flash, offset: u32, size: u32) { info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(offset, offset + size)); + unwrap!(f.blocking_erase(offset, offset + size)); info!("Reading..."); let mut buf = [0u8; 32]; @@ -43,7 +43,7 @@ fn test_flash(f: &mut Flash, offset: u32, size: u32) { info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking( + unwrap!(f.blocking_write( offset, &[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs index f3b66755..35d3059b 100644 --- a/examples/stm32f7/src/bin/flash.rs +++ b/examples/stm32f7/src/bin/flash.rs @@ -22,19 +22,19 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 256 * 1024)); + unwrap!(f.blocking_erase(ADDR, ADDR + 256 * 1024)); info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking( + unwrap!(f.blocking_write( ADDR, &[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -44,7 +44,7 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!( &buf[..], diff --git a/examples/stm32h7/src/bin/flash.rs b/examples/stm32h7/src/bin/flash.rs index 982e2451..f66df770 100644 --- a/examples/stm32h7/src/bin/flash.rs +++ b/examples/stm32h7/src/bin/flash.rs @@ -22,19 +22,19 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 128 * 1024)); + unwrap!(f.blocking_erase(ADDR, ADDR + 128 * 1024)); info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking( + unwrap!(f.blocking_write( ADDR, &[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -44,7 +44,7 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 32]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!( &buf[..], diff --git a/examples/stm32l0/src/bin/flash.rs b/examples/stm32l0/src/bin/flash.rs index f057421f..86f6c70b 100644 --- a/examples/stm32l0/src/bin/flash.rs +++ b/examples/stm32l0/src/bin/flash.rs @@ -18,23 +18,23 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 128)); + unwrap!(f.blocking_erase(ADDR, ADDR + 128)); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); + unwrap!(f.blocking_write(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!(&buf[..], &[1, 2, 3, 4, 5, 6, 7, 8]); } diff --git a/examples/stm32l1/src/bin/flash.rs b/examples/stm32l1/src/bin/flash.rs index 8046f16b..aeb535cc 100644 --- a/examples/stm32l1/src/bin/flash.rs +++ b/examples/stm32l1/src/bin/flash.rs @@ -18,23 +18,23 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 256)); + unwrap!(f.blocking_erase(ADDR, ADDR + 256)); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read after erase: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); + unwrap!(f.blocking_write(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!(&buf[..], &[1, 2, 3, 4, 5, 6, 7, 8]); } diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs index 81e365fb..5e52d49e 100644 --- a/examples/stm32wl/src/bin/flash.rs +++ b/examples/stm32wl/src/bin/flash.rs @@ -18,23 +18,23 @@ async fn main(_spawner: Spawner) { info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Erasing..."); - unwrap!(f.erase_blocking(ADDR, ADDR + 2048)); + unwrap!(f.blocking_erase(ADDR, ADDR + 2048)); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); info!("Writing..."); - unwrap!(f.write_blocking(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); + unwrap!(f.blocking_write(ADDR, &[1, 2, 3, 4, 5, 6, 7, 8])); info!("Reading..."); let mut buf = [0u8; 8]; - unwrap!(f.read_blocking(ADDR, &mut buf)); + unwrap!(f.blocking_read(ADDR, &mut buf)); info!("Read: {=[u8]:x}", buf); assert_eq!(&buf[..], &[1, 2, 3, 4, 5, 6, 7, 8]); }