diff options
Diffstat (limited to 'embassy-boot/stm32/src/lib.rs')
| -rw-r--r-- | embassy-boot/stm32/src/lib.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/embassy-boot/stm32/src/lib.rs b/embassy-boot/stm32/src/lib.rs index c418cb262..4b4091ac9 100644 --- a/embassy-boot/stm32/src/lib.rs +++ b/embassy-boot/stm32/src/lib.rs | |||
| @@ -10,7 +10,10 @@ pub use embassy_boot::{ | |||
| 10 | use embedded_storage::nor_flash::NorFlash; | 10 | use embedded_storage::nor_flash::NorFlash; |
| 11 | 11 | ||
| 12 | /// A bootloader for STM32 devices. | 12 | /// A bootloader for STM32 devices. |
| 13 | pub struct BootLoader; | 13 | pub struct BootLoader { |
| 14 | /// The reported state of the bootloader after preparing for boot | ||
| 15 | pub state: State, | ||
| 16 | } | ||
| 14 | 17 | ||
| 15 | impl BootLoader { | 18 | impl BootLoader { |
| 16 | /// Inspect the bootloader state and perform actions required before booting, such as swapping firmware | 19 | /// Inspect the bootloader state and perform actions required before booting, such as swapping firmware |
| @@ -19,8 +22,8 @@ impl BootLoader { | |||
| 19 | ) -> Self { | 22 | ) -> Self { |
| 20 | let mut aligned_buf = AlignedBuffer([0; BUFFER_SIZE]); | 23 | let mut aligned_buf = AlignedBuffer([0; BUFFER_SIZE]); |
| 21 | let mut boot = embassy_boot::BootLoader::new(config); | 24 | let mut boot = embassy_boot::BootLoader::new(config); |
| 22 | boot.prepare_boot(aligned_buf.as_mut()).expect("Boot prepare error"); | 25 | let state = boot.prepare_boot(aligned_buf.as_mut()).expect("Boot prepare error"); |
| 23 | Self | 26 | Self { state } |
| 24 | } | 27 | } |
| 25 | 28 | ||
| 26 | /// Boots the application. | 29 | /// Boots the application. |
