aboutsummaryrefslogtreecommitdiff
path: root/embassy-boot-rp
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-boot-rp')
-rw-r--r--embassy-boot-rp/src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/embassy-boot-rp/src/lib.rs b/embassy-boot-rp/src/lib.rs
index d0a393bed..3e1731f5e 100644
--- a/embassy-boot-rp/src/lib.rs
+++ b/embassy-boot-rp/src/lib.rs
@@ -21,7 +21,13 @@ impl<const BUFFER_SIZE: usize> BootLoader<BUFFER_SIZE> {
21 pub fn prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash>( 21 pub fn prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash>(
22 config: BootLoaderConfig<ACTIVE, DFU, STATE>, 22 config: BootLoaderConfig<ACTIVE, DFU, STATE>,
23 ) -> Self { 23 ) -> Self {
24 Self::try_prepare::<ACTIVE, DFU, STATE>(config).expect("Boot prepare error") 24 if let Ok(loader) = Self::try_prepare::<ACTIVE, DFU, STATE>(config) {
25 loader
26 } else {
27 // Use explicit panic instead of .expect() to ensure this gets routed via defmt/etc.
28 // properly
29 panic!("Boot prepare error")
30 }
25 } 31 }
26 32
27 /// Inspect the bootloader state and perform actions required before booting, such as swapping firmware 33 /// Inspect the bootloader state and perform actions required before booting, such as swapping firmware