From 2afff617f652d0fdcfa9ffcfd49062e3d2c996a3 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 19 Apr 2022 14:42:38 +0200 Subject: Support multiple flash instances in embassy-boot * Add FlashProvider and FlashConfig traits to define flash characteristics * Use traits in bootloader to retrieve flash handles and for copying data between flash instances * Add convenience implementations for using a single flash instance. --- examples/boot/src/bin/a.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples/boot/src') diff --git a/examples/boot/src/bin/a.rs b/examples/boot/src/bin/a.rs index 88880e688..d18b508cc 100644 --- a/examples/boot/src/bin/a.rs +++ b/examples/boot/src/bin/a.rs @@ -12,7 +12,6 @@ use embassy_nrf::{ Peripherals, }; use embassy_traits::adapter::BlockingAsync; -use embedded_hal::digital::v2::InputPin; use panic_reset as _; static APP_B: &[u8] = include_bytes!("../../b.bin"); @@ -29,14 +28,14 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) { loop { button.wait_for_any_edge().await; - if button.is_low().unwrap() { + if button.is_low() { let mut updater = updater::new(); let mut offset = 0; for chunk in APP_B.chunks(4096) { let mut buf: [u8; 4096] = [0; 4096]; buf[..chunk.len()].copy_from_slice(chunk); updater - .write_firmware(offset, &buf, &mut nvmc) + .write_firmware(offset, &buf, &mut nvmc, 4096) .await .unwrap(); offset += chunk.len(); -- cgit