diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-09-02 06:26:08 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-02 06:26:08 +0000 |
| commit | 8b464d2668657284527693fbf9cc348766a00758 (patch) | |
| tree | d2f9a27e103cab8e02b42c84201d37bf8a02e1b3 /examples/boot/bootloader | |
| parent | 835b69456d6a270e6d5c869da46c0df30fe54254 (diff) | |
| parent | 3ca73144765411994759194a2279b567f4508be5 (diff) | |
Merge #935
935: Remove generic const expressions from embassy-boot r=lulf a=lulf
* 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
Co-authored-by: Ulf Lilleengen <[email protected]>
Diffstat (limited to 'examples/boot/bootloader')
| -rw-r--r-- | examples/boot/bootloader/nrf/src/main.rs | 6 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32/src/main.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/boot/bootloader/nrf/src/main.rs b/examples/boot/bootloader/nrf/src/main.rs index bc7e0755f..9031997c2 100644 --- a/examples/boot/bootloader/nrf/src/main.rs +++ b/examples/boot/bootloader/nrf/src/main.rs | |||
| @@ -20,10 +20,8 @@ fn main() -> ! { | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | let mut bl = BootLoader::default(); | 22 | let mut bl = BootLoader::default(); |
| 23 | let start = bl.prepare(&mut SingleFlashProvider::new(&mut WatchdogFlash::start( | 23 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut BootFlash::<_, 4096>::new( |
| 24 | Nvmc::new(p.NVMC), | 24 | &mut WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5), |
| 25 | p.WDT, | ||
| 26 | 5, | ||
| 27 | ))); | 25 | ))); |
| 28 | unsafe { bl.load(start) } | 26 | unsafe { bl.load(start) } |
| 29 | } | 27 | } |
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 | } |
