diff options
| author | melvdl <[email protected]> | 2025-06-27 01:08:45 +0200 |
|---|---|---|
| committer | melvdl <[email protected]> | 2025-06-27 01:08:45 +0200 |
| commit | 41327c1325367177548dabc644636617274de7f4 (patch) | |
| tree | b389d87f80f0843db946635837691982e41740a0 /examples/stm32g0/src/bin/input_capture.rs | |
| parent | 6f88c2c73caa63a6e534130f4a064cb95d3e9d7d (diff) | |
stm32: adapt examples to timer API changes
Diffstat (limited to 'examples/stm32g0/src/bin/input_capture.rs')
| -rw-r--r-- | examples/stm32g0/src/bin/input_capture.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32g0/src/bin/input_capture.rs b/examples/stm32g0/src/bin/input_capture.rs index 08df4e043..df339d541 100644 --- a/examples/stm32g0/src/bin/input_capture.rs +++ b/examples/stm32g0/src/bin/input_capture.rs | |||
| @@ -47,12 +47,12 @@ async fn main(spawner: Spawner) { | |||
| 47 | unwrap!(spawner.spawn(blinky(p.PB1))); | 47 | unwrap!(spawner.spawn(blinky(p.PB1))); |
| 48 | 48 | ||
| 49 | // Connect PB1 and PA8 with a 1k Ohm resistor | 49 | // Connect PB1 and PA8 with a 1k Ohm resistor |
| 50 | let ch1_pin = PwmPin::new_ch1(p.PA8, OutputType::PushPull); | 50 | let ch1_pin = PwmPin::new(p.PA8, OutputType::PushPull); |
| 51 | let mut pwm = SimplePwm::new(p.TIM1, Some(ch1_pin), None, None, None, khz(1), Default::default()); | 51 | let mut pwm = SimplePwm::new(p.TIM1, Some(ch1_pin), None, None, None, khz(1), Default::default()); |
| 52 | pwm.ch1().enable(); | 52 | pwm.ch1().enable(); |
| 53 | pwm.ch1().set_duty_cycle(50); | 53 | pwm.ch1().set_duty_cycle(50); |
| 54 | 54 | ||
| 55 | let ch1 = CapturePin::new_ch1(p.PA0, Pull::None); | 55 | let ch1 = CapturePin::new(p.PA0, Pull::None); |
| 56 | let mut ic = InputCapture::new(p.TIM2, Some(ch1), None, None, None, Irqs, khz(1000), Default::default()); | 56 | let mut ic = InputCapture::new(p.TIM2, Some(ch1), None, None, None, Irqs, khz(1000), Default::default()); |
| 57 | 57 | ||
| 58 | let mut old_capture = 0; | 58 | let mut old_capture = 0; |
