aboutsummaryrefslogtreecommitdiff
path: root/examples/boot
diff options
context:
space:
mode:
authorRasmus Melchior Jacobsen <[email protected]>2023-05-30 14:05:38 +0200
committerRasmus Melchior Jacobsen <[email protected]>2023-05-30 14:05:38 +0200
commitb527cc98af97e43186a9676b78b4b7f7ece1fa86 (patch)
treeb94baebd21987ed76f37c8791b4427489b2dfee9 /examples/boot
parent36e00caf4dc70905b735531c0d5634addd026954 (diff)
Formatting
Diffstat (limited to 'examples/boot')
-rw-r--r--examples/boot/application/rp/src/bin/a.rs9
-rw-r--r--examples/boot/application/stm32f3/src/bin/a.rs2
-rw-r--r--examples/boot/application/stm32f7/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32h7/src/bin/a.rs4
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
5use core::cell::RefCell;
6
5use defmt_rtt as _; 7use defmt_rtt as _;
6use embassy_boot_rp::*; 8use embassy_boot_rp::*;
7use embassy_executor::Spawner; 9use embassy_executor::Spawner;
8use embassy_rp::flash::Flash; 10use embassy_rp::flash::Flash;
9use embassy_rp::gpio::{Level, Output}; 11use embassy_rp::gpio::{Level, Output};
10use embassy_rp::watchdog::Watchdog; 12use embassy_rp::watchdog::Watchdog;
11use embassy_time::{Duration, Timer};
12use embassy_sync::blocking_mutex::Mutex; 13use embassy_sync::blocking_mutex::Mutex;
13use core::cell::RefCell; 14use embassy_time::{Duration, Timer};
14use embedded_storage::nor_flash::NorFlash; 15use embedded_storage::nor_flash::NorFlash;
15#[cfg(feature = "panic-probe")] 16#[cfg(feature = "panic-probe")]
16use panic_probe as _; 17use 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")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; 7use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
8use embassy_sync::mutex::Mutex;
9use embassy_embedded_hal::adapter::BlockingAsync; 8use embassy_embedded_hal::adapter::BlockingAsync;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
11use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
12use embassy_stm32::flash::{Flash, WRITE_SIZE}; 11use embassy_stm32::flash::{Flash, WRITE_SIZE};
13use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
13use embassy_sync::mutex::Mutex;
14use panic_reset as _; 14use panic_reset as _;
15 15
16static APP_B: &[u8] = include_bytes!("../../b.bin"); 16static 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]);