aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/stm32wl/src
diff options
context:
space:
mode:
authorWillaWillNot <[email protected]>2025-11-20 16:24:15 -0500
committerWillaWillNot <[email protected]>2025-11-21 16:36:15 -0500
commit623623a25f213f76de932eaf4458c3120823d205 (patch)
treea1039bcdb29488180f4fe669f16ac0b33370404e /examples/boot/application/stm32wl/src
parentde4d7f56473df58d9b3fa8ec4917ab86550005ae (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')
-rw-r--r--examples/boot/application/stm32wl/src/bin/a.rs16
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};
9use embassy_embedded_hal::adapter::BlockingAsync; 9use embassy_embedded_hal::adapter::BlockingAsync;
10use embassy_executor::Spawner; 10use embassy_executor::Spawner;
11use embassy_stm32::SharedData; 11use embassy_stm32::SharedData;
12use embassy_stm32::exti::ExtiInput; 12use embassy_stm32::bind_interrupts;
13use embassy_stm32::exti::{self, ExtiInput};
13use embassy_stm32::flash::{Flash, WRITE_SIZE}; 14use embassy_stm32::flash::{Flash, WRITE_SIZE};
14use embassy_stm32::gpio::{Level, Output, Pull, Speed}; 15use embassy_stm32::gpio::{Level, Output, Pull, Speed};
16use embassy_stm32::interrupt;
15use embassy_sync::mutex::Mutex; 17use embassy_sync::mutex::Mutex;
16use panic_reset as _; 18use 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"))]
21static APP_B: &[u8] = include_bytes!("../../b.bin"); 23static APP_B: &[u8] = include_bytes!("../../b.bin");
22 24
25bind_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")]
24static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit(); 31static 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();