diff options
Diffstat (limited to 'examples/boot/application/stm32l1')
| -rw-r--r-- | examples/boot/application/stm32l1/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/boot/application/stm32l1/src/bin/a.rs | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 207eed733..af2cb3881 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | edition = "2021" | 2 | edition = "2024" |
| 3 | name = "embassy-boot-stm32l1-examples" | 3 | name = "embassy-boot-stm32l1-examples" |
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index dcc10e5c6..7ad7046fb 100644 --- a/examples/boot/application/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs | |||
| @@ -6,9 +6,10 @@ use defmt_rtt::*; | |||
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::{self, ExtiInput}; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_stm32::{bind_interrupts, interrupt}; | ||
| 12 | use embassy_sync::mutex::Mutex; | 13 | use embassy_sync::mutex::Mutex; |
| 13 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 14 | use panic_reset as _; | 15 | use panic_reset as _; |
| @@ -18,13 +19,18 @@ static APP_B: &[u8] = &[0, 1, 2, 3]; | |||
| 18 | #[cfg(not(feature = "skip-include"))] | 19 | #[cfg(not(feature = "skip-include"))] |
| 19 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 20 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 20 | 21 | ||
| 22 | bind_interrupts!( | ||
| 23 | pub struct Irqs{ | ||
| 24 | EXTI2 => exti::InterruptHandler<interrupt::typelevel::EXTI2>; | ||
| 25 | }); | ||
| 26 | |||
| 21 | #[embassy_executor::main] | 27 | #[embassy_executor::main] |
| 22 | async fn main(_spawner: Spawner) { | 28 | async fn main(_spawner: Spawner) { |
| 23 | let p = embassy_stm32::init(Default::default()); | 29 | let p = embassy_stm32::init(Default::default()); |
| 24 | let flash = Flash::new_blocking(p.FLASH); | 30 | let flash = Flash::new_blocking(p.FLASH); |
| 25 | let flash = Mutex::new(BlockingAsync::new(flash)); | 31 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 26 | 32 | ||
| 27 | let mut button = ExtiInput::new(p.PB2, p.EXTI2, Pull::Up); | 33 | let mut button = ExtiInput::new(p.PB2, p.EXTI2, Pull::Up, Irqs); |
| 28 | 34 | ||
| 29 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); | 35 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); |
| 30 | 36 | ||
