diff options
| author | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
|---|---|---|
| committer | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
| commit | 6bb3d2c0720fa082f27d3cdb70f516058497ec87 (patch) | |
| tree | 5a1e255cff999b00800f203b91a759c720c973e5 /examples/stm32f1/src/bin/input_capture.rs | |
| parent | eb685574601d98c44faed9a3534d056199b46e20 (diff) | |
| parent | 92a6fd2946f2cbb15359290f68aa360953da2ff7 (diff) | |
Merge branch 'main' into rp2040-rtc-alarm
Diffstat (limited to 'examples/stm32f1/src/bin/input_capture.rs')
| -rw-r--r-- | examples/stm32f1/src/bin/input_capture.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/stm32f1/src/bin/input_capture.rs b/examples/stm32f1/src/bin/input_capture.rs index 6fe8e0b50..b5b26938d 100644 --- a/examples/stm32f1/src/bin/input_capture.rs +++ b/examples/stm32f1/src/bin/input_capture.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 6 | use embassy_stm32::gpio::{AfioRemap, Level, Output, Pull, Speed}; |
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; | 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; |
| 9 | use embassy_stm32::timer::{self, Channel}; | 9 | use embassy_stm32::timer::{self, Channel}; |
| @@ -37,10 +37,11 @@ async fn main(spawner: Spawner) { | |||
| 37 | let p = embassy_stm32::init(Default::default()); | 37 | let p = embassy_stm32::init(Default::default()); |
| 38 | info!("Hello World!"); | 38 | info!("Hello World!"); |
| 39 | 39 | ||
| 40 | unwrap!(spawner.spawn(blinky(p.PC13))); | 40 | spawner.spawn(unwrap!(blinky(p.PC13))); |
| 41 | 41 | ||
| 42 | let ch3 = CapturePin::new_ch3(p.PA2, Pull::None); | 42 | let ch3 = CapturePin::new(p.PA2, Pull::None); |
| 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); | 43 | let mut ic = |
| 44 | InputCapture::new::<AfioRemap<0>>(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); | ||
| 44 | 45 | ||
| 45 | loop { | 46 | loop { |
| 46 | info!("wait for rising edge"); | 47 | info!("wait for rising edge"); |
