diff options
Diffstat (limited to 'embassy-boot/nrf/src')
| -rw-r--r-- | embassy-boot/nrf/src/lib.rs | 6 | ||||
| -rw-r--r-- | embassy-boot/nrf/src/main.rs | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/embassy-boot/nrf/src/lib.rs b/embassy-boot/nrf/src/lib.rs index 32250b2db..785cb67e8 100644 --- a/embassy-boot/nrf/src/lib.rs +++ b/embassy-boot/nrf/src/lib.rs | |||
| @@ -4,7 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | mod fmt; | 5 | mod fmt; |
| 6 | 6 | ||
| 7 | pub use embassy_boot::{FirmwareUpdater, Partition, State, BOOT_MAGIC}; | 7 | pub use embassy_boot::{ |
| 8 | FirmwareUpdater, FlashProvider, Partition, SingleFlashProvider, State, BOOT_MAGIC, | ||
| 9 | }; | ||
| 8 | use embassy_nrf::{ | 10 | use embassy_nrf::{ |
| 9 | nvmc::{Nvmc, PAGE_SIZE}, | 11 | nvmc::{Nvmc, PAGE_SIZE}, |
| 10 | peripherals::WDT, | 12 | peripherals::WDT, |
| @@ -62,7 +64,7 @@ impl BootLoader { | |||
| 62 | } | 64 | } |
| 63 | 65 | ||
| 64 | /// Boots the application without softdevice mechanisms | 66 | /// Boots the application without softdevice mechanisms |
| 65 | pub fn prepare<F: NorFlash + ReadNorFlash>(&mut self, flash: &mut F) -> usize { | 67 | pub fn prepare<F: FlashProvider>(&mut self, flash: &mut F) -> usize { |
| 66 | match self.boot.prepare_boot(flash) { | 68 | match self.boot.prepare_boot(flash) { |
| 67 | Ok(_) => self.boot.boot_address(), | 69 | Ok(_) => self.boot.boot_address(), |
| 68 | Err(_) => panic!("boot prepare error!"), | 70 | Err(_) => panic!("boot prepare error!"), |
diff --git a/embassy-boot/nrf/src/main.rs b/embassy-boot/nrf/src/main.rs index cd264d4c2..63de7c869 100644 --- a/embassy-boot/nrf/src/main.rs +++ b/embassy-boot/nrf/src/main.rs | |||
| @@ -22,7 +22,11 @@ fn main() -> ! { | |||
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | let mut bl = BootLoader::default(); | 24 | let mut bl = BootLoader::default(); |
| 25 | let start = bl.prepare(&mut WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5)); | 25 | let start = bl.prepare(&mut SingleFlashProvider::new(&mut WatchdogFlash::start( |
| 26 | Nvmc::new(p.NVMC), | ||
| 27 | p.WDT, | ||
| 28 | 5, | ||
| 29 | ))); | ||
| 26 | unsafe { bl.load(start) } | 30 | unsafe { bl.load(start) } |
| 27 | } | 31 | } |
| 28 | 32 | ||
