diff options
| author | Ulf Lilleengen <[email protected]> | 2022-08-30 13:07:35 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2022-09-02 08:25:36 +0200 |
| commit | 3ca73144765411994759194a2279b567f4508be5 (patch) | |
| tree | 7c2466e14eb91321d35f831384c633f9936e8977 /examples/boot/bootloader/stm32/src | |
| parent | 7542505cf903930520773f5b6b5ff239b78a8f9c (diff) | |
Remove generic const expressions from embassy-boot
* Remove the need for generic const expressions and use buffers provided in the flash config.
* Extend embedded-storage traits to simplify generics.
* Document all public APIs
* Add toplevel README
* Expose AlignedBuffer type for convenience.
* Update examples
Diffstat (limited to 'examples/boot/bootloader/stm32/src')
| -rw-r--r-- | examples/boot/bootloader/stm32/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/boot/bootloader/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs index 45c511ced..bb5d3e531 100644 --- a/examples/boot/bootloader/stm32/src/main.rs +++ b/examples/boot/bootloader/stm32/src/main.rs | |||
| @@ -5,7 +5,7 @@ use cortex_m_rt::{entry, exception}; | |||
| 5 | #[cfg(feature = "defmt")] | 5 | #[cfg(feature = "defmt")] |
| 6 | use defmt_rtt as _; | 6 | use defmt_rtt as _; |
| 7 | use embassy_boot_stm32::*; | 7 | use embassy_boot_stm32::*; |
| 8 | use embassy_stm32::flash::{Flash, ERASE_SIZE}; | 8 | use embassy_stm32::flash::{Flash, ERASE_SIZE, ERASE_VALUE, WRITE_SIZE}; |
| 9 | 9 | ||
| 10 | #[entry] | 10 | #[entry] |
| 11 | fn main() -> ! { | 11 | fn main() -> ! { |
| @@ -19,9 +19,11 @@ fn main() -> ! { | |||
| 19 | } | 19 | } |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | let mut bl: BootLoader<ERASE_SIZE> = BootLoader::default(); | 22 | let mut bl: BootLoader<ERASE_SIZE, WRITE_SIZE> = BootLoader::default(); |
| 23 | let mut flash = Flash::unlock(p.FLASH); | 23 | let mut flash = Flash::unlock(p.FLASH); |
| 24 | let start = bl.prepare(&mut SingleFlashProvider::new(&mut flash)); | 24 | let start = bl.prepare(&mut SingleFlashConfig::new( |
| 25 | &mut BootFlash::<_, ERASE_SIZE, ERASE_VALUE>::new(&mut flash), | ||
| 26 | )); | ||
| 25 | core::mem::drop(flash); | 27 | core::mem::drop(flash); |
| 26 | unsafe { bl.load(start) } | 28 | unsafe { bl.load(start) } |
| 27 | } | 29 | } |
