aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/rp/src/bin/a.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/boot/application/rp/src/bin/a.rs')
-rw-r--r--examples/boot/application/rp/src/bin/a.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/boot/application/rp/src/bin/a.rs b/examples/boot/application/rp/src/bin/a.rs
index b5e1950cc..f0dda39d0 100644
--- a/examples/boot/application/rp/src/bin/a.rs
+++ b/examples/boot/application/rp/src/bin/a.rs
@@ -38,7 +38,8 @@ async fn main(_s: Spawner) {
38 let flash = Mutex::new(RefCell::new(flash)); 38 let flash = Mutex::new(RefCell::new(flash));
39 39
40 let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash); 40 let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
41 let mut updater = BlockingFirmwareUpdater::new(config); 41 let mut aligned = AlignedBuffer([0; 4]);
42 let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0);
42 43
43 Timer::after(Duration::from_secs(5)).await; 44 Timer::after(Duration::from_secs(5)).await;
44 watchdog.feed(); 45 watchdog.feed();
@@ -47,7 +48,7 @@ async fn main(_s: Spawner) {
47 let mut buf: AlignedBuffer<4096> = AlignedBuffer([0; 4096]); 48 let mut buf: AlignedBuffer<4096> = AlignedBuffer([0; 4096]);
48 defmt::info!("preparing update"); 49 defmt::info!("preparing update");
49 let writer = updater 50 let writer = updater
50 .prepare_update(&mut buf.0[..1]) 51 .prepare_update()
51 .map_err(|e| defmt::warn!("E: {:?}", defmt::Debug2Format(&e))) 52 .map_err(|e| defmt::warn!("E: {:?}", defmt::Debug2Format(&e)))
52 .unwrap(); 53 .unwrap();
53 defmt::info!("writer created, starting write"); 54 defmt::info!("writer created, starting write");
@@ -59,7 +60,7 @@ async fn main(_s: Spawner) {
59 } 60 }
60 watchdog.feed(); 61 watchdog.feed();
61 defmt::info!("firmware written, marking update"); 62 defmt::info!("firmware written, marking update");
62 updater.mark_updated(&mut buf.0[..1]).unwrap(); 63 updater.mark_updated().unwrap();
63 Timer::after(Duration::from_secs(2)).await; 64 Timer::after(Duration::from_secs(2)).await;
64 led.set_low(); 65 led.set_low();
65 defmt::info!("update marked, resetting"); 66 defmt::info!("update marked, resetting");