Formatting
This commit is contained in:
parent
36e00caf4d
commit
b527cc98af
4 changed files with 7 additions and 12 deletions
|
@ -2,15 +2,16 @@
|
|||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
use core::cell::RefCell;
|
||||
|
||||
use defmt_rtt as _;
|
||||
use embassy_boot_rp::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::flash::Flash;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::watchdog::Watchdog;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embassy_sync::blocking_mutex::Mutex;
|
||||
use core::cell::RefCell;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embedded_storage::nor_flash::NorFlash;
|
||||
#[cfg(feature = "panic-probe")]
|
||||
use panic_probe as _;
|
||||
|
@ -49,9 +50,7 @@ async fn main(_s: Spawner) {
|
|||
for chunk in APP_B.chunks(4096) {
|
||||
buf.0[..chunk.len()].copy_from_slice(chunk);
|
||||
defmt::info!("writing block at offset {}", offset);
|
||||
writer
|
||||
.write(offset, &buf.0[..])
|
||||
.unwrap();
|
||||
writer.write(offset, &buf.0[..]).unwrap();
|
||||
offset += chunk.len() as u32;
|
||||
}
|
||||
watchdog.feed();
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
#[cfg(feature = "defmt-rtt")]
|
||||
use defmt_rtt::*;
|
||||
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
|
||||
use embassy_sync::mutex::Mutex;
|
||||
use embassy_embedded_hal::adapter::BlockingAsync;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::exti::ExtiInput;
|
||||
use embassy_stm32::flash::{Flash, WRITE_SIZE};
|
||||
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||
use embassy_sync::mutex::Mutex;
|
||||
use panic_reset as _;
|
||||
|
||||
static APP_B: &[u8] = include_bytes!("../../b.bin");
|
||||
|
|
|
@ -33,9 +33,7 @@ async fn main(_spawner: Spawner) {
|
|||
let mut buf = AlignedBuffer([0; 4096]);
|
||||
for chunk in APP_B.chunks(4096) {
|
||||
buf.as_mut()[..chunk.len()].copy_from_slice(chunk);
|
||||
writer
|
||||
.write(offset, buf.as_ref())
|
||||
.unwrap();
|
||||
writer.write(offset, buf.as_ref()).unwrap();
|
||||
offset += chunk.len();
|
||||
}
|
||||
let mut magic = AlignedBuffer([0; WRITE_SIZE]);
|
||||
|
|
|
@ -33,9 +33,7 @@ async fn main(_spawner: Spawner) {
|
|||
let mut buf = AlignedBuffer([0; 4096]);
|
||||
for chunk in APP_B.chunks(4096) {
|
||||
buf.as_mut()[..chunk.len()].copy_from_slice(chunk);
|
||||
writer
|
||||
.write(offset, buf.as_ref())
|
||||
.unwrap();
|
||||
writer.write(offset, buf.as_ref()).unwrap();
|
||||
offset += chunk.len();
|
||||
}
|
||||
let mut magic = AlignedBuffer([0; WRITE_SIZE]);
|
||||
|
|
Loading…
Reference in a new issue