diff options
Diffstat (limited to 'examples/boot/application/stm32h7/src')
| -rw-r--r-- | examples/boot/application/stm32h7/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32h7/src/bin/b.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index cc363bb32..8407adac3 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -6,16 +6,17 @@ | |||
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy_boot_stm32::FirmwareUpdater; | 7 | use embassy_boot_stm32::FirmwareUpdater; |
| 8 | use embassy_embedded_hal::adapter::BlockingAsync; | 8 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 9 | use embassy_executor::executor::Spawner; | ||
| 9 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::Flash; | 11 | use embassy_stm32::flash::Flash; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 12 | use embassy_stm32::Peripherals; | ||
| 13 | use panic_reset as _; | 13 | use panic_reset as _; |
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy_executor::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { | 18 | async fn main(_spawner: Spawner) { |
| 19 | let p = embassy_stm32::init(Default::default()); | ||
| 19 | let flash = Flash::unlock(p.FLASH); | 20 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 21 | let mut flash = BlockingAsync::new(flash); |
| 21 | 22 | ||
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs index 3fa63bdcf..cc694e843 100644 --- a/examples/boot/application/stm32h7/src/bin/b.rs +++ b/examples/boot/application/stm32h7/src/bin/b.rs | |||
| @@ -7,11 +7,11 @@ use defmt_rtt::*; | |||
| 7 | use embassy_executor::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy_executor::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | ||
| 11 | use panic_reset as _; | 10 | use panic_reset as _; |
| 12 | 11 | ||
| 13 | #[embassy_executor::main] | 12 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner) { |
| 14 | let p = embassy_stm32::init(Default::default()); | ||
| 15 | Timer::after(Duration::from_millis(300)).await; | 15 | Timer::after(Duration::from_millis(300)).await; |
| 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); | 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); |
| 17 | led.set_high(); | 17 | led.set_high(); |
