diff options
Diffstat (limited to 'examples/boot/src/bin')
| -rw-r--r-- | examples/boot/src/bin/a.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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::{ | |||
| 12 | Peripherals, | 12 | Peripherals, |
| 13 | }; | 13 | }; |
| 14 | use embassy_traits::adapter::BlockingAsync; | 14 | use embassy_traits::adapter::BlockingAsync; |
| 15 | use embedded_hal::digital::v2::InputPin; | ||
| 16 | use panic_reset as _; | 15 | use panic_reset as _; |
| 17 | 16 | ||
| 18 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 17 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| @@ -29,14 +28,14 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | |||
| 29 | 28 | ||
| 30 | loop { | 29 | loop { |
| 31 | button.wait_for_any_edge().await; | 30 | button.wait_for_any_edge().await; |
| 32 | if button.is_low().unwrap() { | 31 | if button.is_low() { |
| 33 | let mut updater = updater::new(); | 32 | let mut updater = updater::new(); |
| 34 | let mut offset = 0; | 33 | let mut offset = 0; |
| 35 | for chunk in APP_B.chunks(4096) { | 34 | for chunk in APP_B.chunks(4096) { |
| 36 | let mut buf: [u8; 4096] = [0; 4096]; | 35 | let mut buf: [u8; 4096] = [0; 4096]; |
| 37 | buf[..chunk.len()].copy_from_slice(chunk); | 36 | buf[..chunk.len()].copy_from_slice(chunk); |
| 38 | updater | 37 | updater |
| 39 | .write_firmware(offset, &buf, &mut nvmc) | 38 | .write_firmware(offset, &buf, &mut nvmc, 4096) |
| 40 | .await | 39 | .await |
| 41 | .unwrap(); | 40 | .unwrap(); |
| 42 | offset += chunk.len(); | 41 | offset += chunk.len(); |
