diff options
Diffstat (limited to 'embassy-boot/boot/src/lib.rs')
| -rw-r--r-- | embassy-boot/boot/src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-boot/boot/src/lib.rs b/embassy-boot/boot/src/lib.rs index 597ce3fa3..cb12f9dc7 100644 --- a/embassy-boot/boot/src/lib.rs +++ b/embassy-boot/boot/src/lib.rs | |||
| @@ -7,13 +7,11 @@ mod fmt; | |||
| 7 | 7 | ||
| 8 | mod boot_loader; | 8 | mod boot_loader; |
| 9 | mod firmware_updater; | 9 | mod firmware_updater; |
| 10 | mod firmware_writer; | ||
| 11 | mod mem_flash; | 10 | mod mem_flash; |
| 12 | mod partition; | 11 | mod partition; |
| 13 | 12 | ||
| 14 | pub use boot_loader::{BootError, BootFlash, BootLoader, Flash, FlashConfig, MultiFlashConfig, SingleFlashConfig}; | 13 | pub use boot_loader::{BootError, BootFlash, BootLoader, Flash, FlashConfig, MultiFlashConfig, SingleFlashConfig}; |
| 15 | pub use firmware_updater::{FirmwareUpdater, FirmwareUpdaterError}; | 14 | pub use firmware_updater::{FirmwareUpdater, FirmwareUpdaterError}; |
| 16 | pub use firmware_writer::FirmwareWriter; | ||
| 17 | pub use partition::Partition; | 15 | pub use partition::Partition; |
| 18 | 16 | ||
| 19 | pub(crate) const BOOT_MAGIC: u8 = 0xD0; | 17 | pub(crate) const BOOT_MAGIC: u8 = 0xD0; |
| @@ -107,7 +105,7 @@ mod tests { | |||
| 107 | let mut updater = FirmwareUpdater::new(DFU, STATE); | 105 | let mut updater = FirmwareUpdater::new(DFU, STATE); |
| 108 | let mut offset = 0; | 106 | let mut offset = 0; |
| 109 | for chunk in update.chunks(4096) { | 107 | for chunk in update.chunks(4096) { |
| 110 | block_on(updater.write_firmware(offset, chunk, &mut flash, 4096)).unwrap(); | 108 | block_on(updater.write_firmware(offset, chunk, &mut flash)).unwrap(); |
| 111 | offset += chunk.len(); | 109 | offset += chunk.len(); |
| 112 | } | 110 | } |
| 113 | block_on(updater.mark_updated(&mut flash, &mut aligned)).unwrap(); | 111 | block_on(updater.mark_updated(&mut flash, &mut aligned)).unwrap(); |
| @@ -180,7 +178,7 @@ mod tests { | |||
| 180 | 178 | ||
| 181 | let mut offset = 0; | 179 | let mut offset = 0; |
| 182 | for chunk in update.chunks(2048) { | 180 | for chunk in update.chunks(2048) { |
| 183 | block_on(updater.write_firmware(offset, chunk, &mut dfu, chunk.len())).unwrap(); | 181 | block_on(updater.write_firmware(offset, chunk, &mut dfu)).unwrap(); |
| 184 | offset += chunk.len(); | 182 | offset += chunk.len(); |
| 185 | } | 183 | } |
| 186 | block_on(updater.mark_updated(&mut state, &mut aligned)).unwrap(); | 184 | block_on(updater.mark_updated(&mut state, &mut aligned)).unwrap(); |
| @@ -233,7 +231,7 @@ mod tests { | |||
| 233 | 231 | ||
| 234 | let mut offset = 0; | 232 | let mut offset = 0; |
| 235 | for chunk in update.chunks(4096) { | 233 | for chunk in update.chunks(4096) { |
| 236 | block_on(updater.write_firmware(offset, chunk, &mut dfu, chunk.len())).unwrap(); | 234 | block_on(updater.write_firmware(offset, chunk, &mut dfu)).unwrap(); |
| 237 | offset += chunk.len(); | 235 | offset += chunk.len(); |
| 238 | } | 236 | } |
| 239 | block_on(updater.mark_updated(&mut state, &mut aligned)).unwrap(); | 237 | block_on(updater.mark_updated(&mut state, &mut aligned)).unwrap(); |
