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/stm32f3/src | |
| 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/stm32f3/src')
| -rw-r--r-- | examples/boot/application/stm32f3/src/bin/a.rs | 16 |
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::*; | |||
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::bind_interrupts; |
| 10 | use embassy_stm32::exti::{self, ExtiInput}; | ||
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 13 | use embassy_stm32::interrupt; | ||
| 12 | use embassy_sync::mutex::Mutex; | 14 | use embassy_sync::mutex::Mutex; |
| 13 | use panic_reset as _; | 15 | use panic_reset as _; |
| 14 | 16 | ||
| 17 | bind_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")] |
| 16 | static APP_B: &[u8] = &[0, 1, 2, 3]; | 23 | static 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(); |
