diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32u5/src/bin/tsc.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/stm32u5/src/bin/tsc.rs b/examples/stm32u5/src/bin/tsc.rs index f5593d1c4..642bbeaca 100644 --- a/examples/stm32u5/src/bin/tsc.rs +++ b/examples/stm32u5/src/bin/tsc.rs | |||
| @@ -2,10 +2,17 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::tsc::{self, *}; | 5 | use embassy_stm32::{ |
| 6 | bind_interrupts, | ||
| 7 | tsc::{self, *}, | ||
| 8 | }; | ||
| 6 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 11 | ||
| 12 | bind_interrupts!(struct Irqs { | ||
| 13 | TSC => InterruptHandler<embassy_stm32::peripherals::TSC>; | ||
| 14 | }); | ||
| 15 | |||
| 9 | #[cortex_m_rt::exception] | 16 | #[cortex_m_rt::exception] |
| 10 | unsafe fn HardFault(_: &cortex_m_rt::ExceptionFrame) -> ! { | 17 | unsafe fn HardFault(_: &cortex_m_rt::ExceptionFrame) -> ! { |
| 11 | cortex_m::peripheral::SCB::sys_reset(); | 18 | cortex_m::peripheral::SCB::sys_reset(); |
| @@ -47,6 +54,7 @@ async fn main(_spawner: embassy_executor::Spawner) { | |||
| 47 | 54 | ||
| 48 | let mut touch_controller = tsc::Tsc::new( | 55 | let mut touch_controller = tsc::Tsc::new( |
| 49 | context.TSC, | 56 | context.TSC, |
| 57 | Irqs, | ||
| 50 | Some(g1), | 58 | Some(g1), |
| 51 | Some(g2), | 59 | Some(g2), |
| 52 | None, | 60 | None, |
| @@ -67,7 +75,7 @@ async fn main(_spawner: embassy_executor::Spawner) { | |||
| 67 | let mut group_seven_val = 0; | 75 | let mut group_seven_val = 0; |
| 68 | info!("Starting touch_controller interface"); | 76 | info!("Starting touch_controller interface"); |
| 69 | loop { | 77 | loop { |
| 70 | touch_controller.poll_for_acquisition(); | 78 | touch_controller.pend_for_acquisition().await; |
| 71 | touch_controller.discharge_io(true); | 79 | touch_controller.discharge_io(true); |
| 72 | Timer::after_millis(1).await; | 80 | Timer::after_millis(1).await; |
| 73 | 81 | ||
