aboutsummaryrefslogtreecommitdiff
path: root/embassy-boot/src
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-boot/src')
-rw-r--r--embassy-boot/src/boot_loader.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/embassy-boot/src/boot_loader.rs b/embassy-boot/src/boot_loader.rs
index a38558056..789fa34c1 100644
--- a/embassy-boot/src/boot_loader.rs
+++ b/embassy-boot/src/boot_loader.rs
@@ -235,12 +235,15 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash> BootLoader<ACTIVE, DFU, S
235 /// | DFU | 3 | 4 | 5 | 6 | 3 | 235 /// | DFU | 3 | 4 | 5 | 6 | 3 |
236 /// 236 ///
237 pub fn prepare_boot(&mut self, aligned_buf: &mut [u8]) -> Result<State, BootError> { 237 pub fn prepare_boot(&mut self, aligned_buf: &mut [u8]) -> Result<State, BootError> {
238 const {
239 assert!(Self::PAGE_SIZE % ACTIVE::WRITE_SIZE as u32 == 0);
240 assert!(Self::PAGE_SIZE % ACTIVE::ERASE_SIZE as u32 == 0);
241 assert!(Self::PAGE_SIZE % DFU::WRITE_SIZE as u32 == 0);
242 assert!(Self::PAGE_SIZE % DFU::ERASE_SIZE as u32 == 0);
243 }
244
238 // Ensure we have enough progress pages to store copy progress 245 // Ensure we have enough progress pages to store copy progress
239 assert_eq!(0, Self::PAGE_SIZE % aligned_buf.len() as u32); 246 assert_eq!(0, Self::PAGE_SIZE % aligned_buf.len() as u32);
240 assert_eq!(0, Self::PAGE_SIZE % ACTIVE::WRITE_SIZE as u32);
241 assert_eq!(0, Self::PAGE_SIZE % ACTIVE::ERASE_SIZE as u32);
242 assert_eq!(0, Self::PAGE_SIZE % DFU::WRITE_SIZE as u32);
243 assert_eq!(0, Self::PAGE_SIZE % DFU::ERASE_SIZE as u32);
244 assert!(aligned_buf.len() >= STATE::WRITE_SIZE); 247 assert!(aligned_buf.len() >= STATE::WRITE_SIZE);
245 assert_eq!(0, aligned_buf.len() % ACTIVE::WRITE_SIZE); 248 assert_eq!(0, aligned_buf.len() % ACTIVE::WRITE_SIZE);
246 assert_eq!(0, aligned_buf.len() % DFU::WRITE_SIZE); 249 assert_eq!(0, aligned_buf.len() % DFU::WRITE_SIZE);