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/application/stm32l4/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/application/stm32l4/src')
| -rw-r--r-- | examples/boot/application/stm32l4/src/bin/a.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index 178b2e04a..5119bad2e 100644 --- a/examples/boot/application/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy_boot_stm32::FirmwareUpdater; | 7 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater}; |
| 8 | use embassy_embedded_hal::adapter::BlockingAsync; | 8 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::flash::Flash; | 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 13 | use panic_reset as _; | 13 | use panic_reset as _; |
| 14 | 14 | ||
| @@ -35,7 +35,8 @@ async fn main(_spawner: Spawner) { | |||
| 35 | updater.write_firmware(offset, &buf, &mut flash, 2048).await.unwrap(); | 35 | updater.write_firmware(offset, &buf, &mut flash, 2048).await.unwrap(); |
| 36 | offset += chunk.len(); | 36 | offset += chunk.len(); |
| 37 | } | 37 | } |
| 38 | updater.update(&mut flash).await.unwrap(); | 38 | let mut magic = AlignedBuffer([0; WRITE_SIZE]); |
| 39 | updater.mark_updated(&mut flash, magic.as_mut()).await.unwrap(); | ||
| 39 | led.set_low(); | 40 | led.set_low(); |
| 40 | cortex_m::peripheral::SCB::sys_reset(); | 41 | cortex_m::peripheral::SCB::sys_reset(); |
| 41 | } | 42 | } |
