Skip to content

Commit 80f3675

Browse files
committed
cleanup: warnings
1 parent b8bbd6b commit 80f3675

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/ch32v208/src/bin/flash.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(type_alias_impl_trait)]
44
#![feature(impl_trait_in_assoc_type)]
55

6-
use ch32_hal::flash::{Flash, FLASH_BASE};
6+
use ch32_hal::flash::Flash;
77
use ch32_hal::rcc::*;
88
use ch32_hal::{interrupt, println};
99
use embassy_executor::Spawner;
@@ -41,27 +41,27 @@ async fn main(_spawner: Spawner) -> ! {
4141
Timer::after_millis(1000).await;
4242

4343
let mut f = Flash::new_blocking(p.FLASH);
44-
const size: u32 = 256;
44+
const SIZE: u32 = 256;
4545
let start: u32 = 1024 * 32;
4646
let stop = start + 256 * 3;
47-
for offset in (start..stop).step_by(size as usize) {
48-
println!("Testing offset: {:#X}, size: {:#X}", offset, size);
47+
for offset in (start..stop).step_by(SIZE as usize) {
48+
println!("Testing offset: {:#X}, size: {:#X}", offset, SIZE);
4949

5050
println!("Reading...");
5151
let mut buf = [0u8; 32];
5252
println!("{:?}", f.blocking_read(offset, &mut buf));
5353
println!("Read: {:?}", buf);
5454

5555
println!("Erasing...");
56-
println!("{:?}", f.blocking_erase(offset, offset + size));
56+
println!("{:?}", f.blocking_erase(offset, offset + SIZE));
5757

5858
println!("Reading...");
5959
let mut buf = [0u8; 32];
6060
println!("{:?}", f.blocking_read(offset, &mut buf));
6161
println!("Read after erase: {:?}", buf);
6262

6363
println!("Writing...");
64-
println!("{:?}", f.blocking_write(offset, &[0xabu8; size as usize]));
64+
println!("{:?}", f.blocking_write(offset, &[0xabu8; SIZE as usize]));
6565

6666
println!("Reading...");
6767
let mut buf = [0u8; 32];

0 commit comments

Comments
 (0)