aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/stm32f3/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/stm32f3/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/stm32f3/src')
-rw-r--r--examples/boot/application/stm32f3/src/bin/a.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs
index b608b2e01..e42e24885 100644
--- a/examples/boot/application/stm32f3/src/bin/a.rs
+++ b/examples/boot/application/stm32f3/src/bin/a.rs
@@ -6,12 +6,19 @@ 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
17bind_interrupts!(
18 pub struct Irqs{
19 EXTI15_10 => exti::InterruptHandler<interrupt::typelevel::EXTI15_10>;
20});
21
15#[cfg(feature = "skip-include")] 22#[cfg(feature = "skip-include")]
16static APP_B: &[u8] = &[0, 1, 2, 3]; 23static APP_B: &[u8] = &[0, 1, 2, 3];
17#[cfg(not(feature = "skip-include"))] 24#[cfg(not(feature = "skip-include"))]
@@ -23,7 +30,12 @@ async fn main(_spawner: Spawner) {
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.PA5, Level::Low, Speed::Low); 40 let mut led = Output::new(p.PA5, Level::Low, Speed::Low);
29 led.set_high(); 41 led.set_high();