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