aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/stm32l4/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/stm32l4/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/stm32l4/src')
-rw-r--r--examples/boot/application/stm32l4/src/bin/a.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs
index 7f8015c04..5e5d45193 100644
--- a/examples/boot/application/stm32l4/src/bin/a.rs
+++ b/examples/boot/application/stm32l4/src/bin/a.rs
@@ -6,9 +6,11 @@ use defmt_rtt::*;
6use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; 6use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
7use embassy_embedded_hal::adapter::BlockingAsync; 7use embassy_embedded_hal::adapter::BlockingAsync;
8use embassy_executor::Spawner; 8use embassy_executor::Spawner;
9use embassy_stm32::exti::ExtiInput; 9use embassy_stm32::bind_interrupts;
10use embassy_stm32::exti::{self, ExtiInput};
10use embassy_stm32::flash::{Flash, WRITE_SIZE}; 11use embassy_stm32::flash::{Flash, WRITE_SIZE};
11use embassy_stm32::gpio::{Level, Output, Pull, Speed}; 12use embassy_stm32::gpio::{Level, Output, Pull, Speed};
13use embassy_stm32::interrupt;
12use embassy_sync::mutex::Mutex; 14use embassy_sync::mutex::Mutex;
13use panic_reset as _; 15use panic_reset as _;
14 16
@@ -17,13 +19,23 @@ static APP_B: &[u8] = &[0, 1, 2, 3];
17#[cfg(not(feature = "skip-include"))] 19#[cfg(not(feature = "skip-include"))]
18static APP_B: &[u8] = include_bytes!("../../b.bin"); 20static APP_B: &[u8] = include_bytes!("../../b.bin");
19 21
22bind_interrupts!(
23 pub struct Irqs{
24 EXTI15_10 => exti::InterruptHandler<interrupt::typelevel::EXTI15_10>;
25});
26
20#[embassy_executor::main] 27#[embassy_executor::main]
21async fn main(_spawner: Spawner) { 28async fn main(_spawner: Spawner) {
22 let p = embassy_stm32::init(Default::default()); 29 let p = embassy_stm32::init(Default::default());
23 let flash = Flash::new_blocking(p.FLASH); 30 let flash = Flash::new_blocking(p.FLASH);
24 let flash = Mutex::new(BlockingAsync::new(flash)); 31 let flash = Mutex::new(BlockingAsync::new(flash));
25 32
26 let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); 33 let mut button = ExtiInput::new(
34 p.PC13,
35 p.EXTI13,
36 Pull::Up,
37 Irqs::as_any::<interrupt::typelevel::EXTI15_10, exti::InterruptHandler<interrupt::typelevel::EXTI15_10>>(),
38 );
27 39
28 let mut led = Output::new(p.PB14, Level::Low, Speed::Low); 40 let mut led = Output::new(p.PB14, Level::Low, Speed::Low);
29 led.set_high(); 41 led.set_high();