aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g0/src/bin/input_capture.rs
diff options
context:
space:
mode:
authorGrant Miller <[email protected]>2024-09-06 13:53:49 -0500
committerGrant Miller <[email protected]>2024-09-06 13:53:49 -0500
commit1a8977db7837a5635d3c5e0ae8213d1b3181ffb7 (patch)
tree5bceb855c421f6572aa1909d997bd6d9dda3b895 /examples/stm32g0/src/bin/input_capture.rs
parentcfc76cec711447300e2d957439a32d6ad418a58c (diff)
Update examples
Diffstat (limited to 'examples/stm32g0/src/bin/input_capture.rs')
-rw-r--r--examples/stm32g0/src/bin/input_capture.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/stm32g0/src/bin/input_capture.rs b/examples/stm32g0/src/bin/input_capture.rs
index 69fdae96d..bc814cb13 100644
--- a/examples/stm32g0/src/bin/input_capture.rs
+++ b/examples/stm32g0/src/bin/input_capture.rs
@@ -47,10 +47,10 @@ 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 = PwmPin::new_ch1(p.PA8, OutputType::PushPull); 50 let ch1_pin = PwmPin::new_ch1(p.PA8, OutputType::PushPull);
51 let mut pwm = SimplePwm::new(p.TIM1, Some(ch1), 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.enable(Channel::Ch1); 52 pwm.ch1().enable();
53 pwm.set_duty(Channel::Ch1, 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_ch1(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());