diff options
| author | WillaWillNot <[email protected]> | 2025-11-20 16:24:15 -0500 |
|---|---|---|
| committer | WillaWillNot <[email protected]> | 2025-11-21 16:36:15 -0500 |
| commit | 623623a25f213f76de932eaf4458c3120823d205 (patch) | |
| tree | a1039bcdb29488180f4fe669f16ac0b33370404e /examples/boot/application/stm32wl/src/bin/a.rs | |
| parent | de4d7f56473df58d9b3fa8ec4917ab86550005ae (diff) | |
Updated documentation, fixed EXTI definition issues with chips that have touch sensing, updated examples, added generation of convenience method to bind_interrupts for easier type erasure
Diffstat (limited to 'examples/boot/application/stm32wl/src/bin/a.rs')
| -rw-r--r-- | examples/boot/application/stm32wl/src/bin/a.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index 3f381fd80..ad45c1262 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -9,9 +9,11 @@ use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | |||
| 9 | use embassy_embedded_hal::adapter::BlockingAsync; | 9 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::SharedData; | 11 | use embassy_stm32::SharedData; |
| 12 | use embassy_stm32::exti::ExtiInput; | 12 | use embassy_stm32::bind_interrupts; |
| 13 | use embassy_stm32::exti::{self, ExtiInput}; | ||
| 13 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 14 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 14 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 15 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 16 | use embassy_stm32::interrupt; | ||
| 15 | use embassy_sync::mutex::Mutex; | 17 | use embassy_sync::mutex::Mutex; |
| 16 | use panic_reset as _; | 18 | use panic_reset as _; |
| 17 | 19 | ||
| @@ -20,6 +22,11 @@ static APP_B: &[u8] = &[0, 1, 2, 3]; | |||
| 20 | #[cfg(not(feature = "skip-include"))] | 22 | #[cfg(not(feature = "skip-include"))] |
| 21 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 23 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 22 | 24 | ||
| 25 | bind_interrupts!( | ||
| 26 | pub struct Irqs{ | ||
| 27 | EXTEXTI0I2_3 => exti::InterruptHandler<interrupt::typelevel::EXTI0>; | ||
| 28 | }); | ||
| 29 | |||
| 23 | #[unsafe(link_section = ".shared_data")] | 30 | #[unsafe(link_section = ".shared_data")] |
| 24 | static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit(); | 31 | static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit(); |
| 25 | 32 | ||
| @@ -29,7 +36,12 @@ async fn main(_spawner: Spawner) { | |||
| 29 | let flash = Flash::new_blocking(p.FLASH); | 36 | let flash = Flash::new_blocking(p.FLASH); |
| 30 | let flash = Mutex::new(BlockingAsync::new(flash)); | 37 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 31 | 38 | ||
| 32 | let mut button = ExtiInput::new(p.PA0, p.EXTI0, Pull::Up); | 39 | let mut button = ExtiInput::new( |
| 40 | p.PA0, | ||
| 41 | p.EXTI0, | ||
| 42 | Pull::Up, | ||
| 43 | Irqs::as_any::<interrupt::typelevel::EXTI0, exti::InterruptHandler<interrupt::typelevel::EXTI0>>(), | ||
| 44 | ); | ||
| 33 | 45 | ||
| 34 | let mut led = Output::new(p.PB9, Level::Low, Speed::Low); | 46 | let mut led = Output::new(p.PB9, Level::Low, Speed::Low); |
| 35 | led.set_high(); | 47 | led.set_high(); |
