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/stm32f7/src/bin | |
| 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/stm32f7/src/bin')
| -rw-r--r-- | examples/boot/application/stm32f7/src/bin/a.rs | 16 |
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; | |||
| 7 | use defmt_rtt::*; | 7 | use defmt_rtt::*; |
| 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; | 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::bind_interrupts; |
| 11 | use embassy_stm32::exti::{self, ExtiInput}; | ||
| 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 12 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 12 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 13 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 14 | use embassy_stm32::interrupt; | ||
| 13 | use embassy_sync::blocking_mutex::Mutex; | 15 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embedded_storage::nor_flash::NorFlash; | 16 | use embedded_storage::nor_flash::NorFlash; |
| 15 | use panic_reset as _; | 17 | use 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"))] |
| 20 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 22 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 21 | 23 | ||
| 24 | bind_interrupts!( | ||
| 25 | pub struct Irqs{ | ||
| 26 | EXTI15_10 => exti::InterruptHandler<interrupt::typelevel::EXTI15_10>; | ||
| 27 | }); | ||
| 28 | |||
| 22 | #[embassy_executor::main] | 29 | #[embassy_executor::main] |
| 23 | async fn main(_spawner: Spawner) { | 30 | async 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(); |
