Route sources of panics to the crate's fmt macros
This commit is contained in:
@@ -20,7 +20,13 @@ impl BootLoader {
|
||||
pub fn prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize>(
|
||||
config: BootLoaderConfig<ACTIVE, DFU, STATE>,
|
||||
) -> Self {
|
||||
Self::try_prepare::<ACTIVE, DFU, STATE, BUFFER_SIZE>(config).expect("Boot prepare error")
|
||||
if let Ok(loader) = Self::try_prepare::<ACTIVE, DFU, STATE, BUFFER_SIZE>(config) {
|
||||
loader
|
||||
} else {
|
||||
// Use explicit panic instead of .expect() to ensure this gets routed via defmt/etc.
|
||||
// properly
|
||||
panic!("Boot prepare error")
|
||||
}
|
||||
}
|
||||
|
||||
/// Inspect the bootloader state and perform actions required before booting, such as swapping firmware
|
||||
|
||||
Reference in New Issue
Block a user