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 | |
| parent | 36e00caf4dc70905b735531c0d5634addd026954 (diff) | |
Formatting
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/boot/application/rp/src/bin/a.rs | 9 | ||||
| -rw-r--r-- | examples/boot/application/stm32f3/src/bin/a.rs | 2 | ||||
| -rw-r--r-- | examples/boot/application/stm32f7/src/bin/a.rs | 4 | ||||
| -rw-r--r-- | examples/boot/application/stm32h7/src/bin/a.rs | 4 |
4 files changed, 7 insertions, 12 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(); |
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 6a5c276fd..c94676f09 100644 --- a/examples/boot/application/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs | |||
| @@ -5,12 +5,12 @@ | |||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 7 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 8 | use embassy_sync::mutex::Mutex; | ||
| 9 | use embassy_embedded_hal::adapter::BlockingAsync; | 8 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 12 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 13 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 13 | use embassy_sync::mutex::Mutex; | ||
| 14 | use panic_reset as _; | 14 | use panic_reset as _; |
| 15 | 15 | ||
| 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index 530683cac..fc2702c91 100644 --- a/examples/boot/application/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs | |||
| @@ -33,9 +33,7 @@ async fn main(_spawner: Spawner) { | |||
| 33 | let mut buf = AlignedBuffer([0; 4096]); | 33 | let mut buf = AlignedBuffer([0; 4096]); |
| 34 | for chunk in APP_B.chunks(4096) { | 34 | for chunk in APP_B.chunks(4096) { |
| 35 | buf.as_mut()[..chunk.len()].copy_from_slice(chunk); | 35 | buf.as_mut()[..chunk.len()].copy_from_slice(chunk); |
| 36 | writer | 36 | writer.write(offset, buf.as_ref()).unwrap(); |
| 37 | .write(offset, buf.as_ref()) | ||
| 38 | .unwrap(); | ||
| 39 | offset += chunk.len(); | 37 | offset += chunk.len(); |
| 40 | } | 38 | } |
| 41 | let mut magic = AlignedBuffer([0; WRITE_SIZE]); | 39 | let mut magic = AlignedBuffer([0; WRITE_SIZE]); |
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index e5f94310c..1a54464d0 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -33,9 +33,7 @@ async fn main(_spawner: Spawner) { | |||
| 33 | let mut buf = AlignedBuffer([0; 4096]); | 33 | let mut buf = AlignedBuffer([0; 4096]); |
| 34 | for chunk in APP_B.chunks(4096) { | 34 | for chunk in APP_B.chunks(4096) { |
| 35 | buf.as_mut()[..chunk.len()].copy_from_slice(chunk); | 35 | buf.as_mut()[..chunk.len()].copy_from_slice(chunk); |
| 36 | writer | 36 | writer.write(offset, buf.as_ref()).unwrap(); |
| 37 | .write(offset, buf.as_ref()) | ||
| 38 | .unwrap(); | ||
| 39 | offset += chunk.len(); | 37 | offset += chunk.len(); |
| 40 | } | 38 | } |
| 41 | let mut magic = AlignedBuffer([0; WRITE_SIZE]); | 39 | let mut magic = AlignedBuffer([0; WRITE_SIZE]); |
