diff options
| author | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-30 14:05:38 +0200 |
|---|---|---|
| committer | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-30 14:05:38 +0200 |
| commit | b527cc98af97e43186a9676b78b4b7f7ece1fa86 (patch) | |
| tree | b94baebd21987ed76f37c8791b4427489b2dfee9 /examples/boot/application/rp/src/bin | |
| parent | 36e00caf4dc70905b735531c0d5634addd026954 (diff) | |
Formatting
Diffstat (limited to 'examples/boot/application/rp/src/bin')
| -rw-r--r-- | examples/boot/application/rp/src/bin/a.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/boot/application/rp/src/bin/a.rs b/examples/boot/application/rp/src/bin/a.rs index 3fa908b63..69850069b 100644 --- a/examples/boot/application/rp/src/bin/a.rs +++ b/examples/boot/application/rp/src/bin/a.rs | |||
| @@ -2,15 +2,16 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use core::cell::RefCell; | ||
| 6 | |||
| 5 | use defmt_rtt as _; | 7 | use defmt_rtt as _; |
| 6 | use embassy_boot_rp::*; | 8 | use embassy_boot_rp::*; |
| 7 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::flash::Flash; | 10 | use embassy_rp::flash::Flash; |
| 9 | use embassy_rp::gpio::{Level, Output}; | 11 | use embassy_rp::gpio::{Level, Output}; |
| 10 | use embassy_rp::watchdog::Watchdog; | 12 | use embassy_rp::watchdog::Watchdog; |
| 11 | use embassy_time::{Duration, Timer}; | ||
| 12 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 13 | use core::cell::RefCell; | 14 | use embassy_time::{Duration, Timer}; |
| 14 | use embedded_storage::nor_flash::NorFlash; | 15 | use embedded_storage::nor_flash::NorFlash; |
| 15 | #[cfg(feature = "panic-probe")] | 16 | #[cfg(feature = "panic-probe")] |
| 16 | use panic_probe as _; | 17 | use panic_probe as _; |
| @@ -49,9 +50,7 @@ async fn main(_s: Spawner) { | |||
| 49 | for chunk in APP_B.chunks(4096) { | 50 | for chunk in APP_B.chunks(4096) { |
| 50 | buf.0[..chunk.len()].copy_from_slice(chunk); | 51 | buf.0[..chunk.len()].copy_from_slice(chunk); |
| 51 | defmt::info!("writing block at offset {}", offset); | 52 | defmt::info!("writing block at offset {}", offset); |
| 52 | writer | 53 | writer.write(offset, &buf.0[..]).unwrap(); |
| 53 | .write(offset, &buf.0[..]) | ||
| 54 | .unwrap(); | ||
| 55 | offset += chunk.len() as u32; | 54 | offset += chunk.len() as u32; |
| 56 | } | 55 | } |
| 57 | watchdog.feed(); | 56 | watchdog.feed(); |
