From a23fa8dcb2e22ed2d8bac15fd875dfe53af43eda Mon Sep 17 00:00:00 2001 From: Bruno Bousquet <21108660+brunob45@users.noreply.github.com> Date: Wed, 29 May 2024 09:14:05 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Romain Reignier --- embassy-stm32/src/timer/pwm_input.rs | 8 ++++---- examples/stm32f1/src/bin/input_capture.rs | 2 +- examples/stm32f1/src/bin/pwm_input.rs | 2 +- examples/stm32f4/src/bin/pwm_input.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/embassy-stm32/src/timer/pwm_input.rs b/embassy-stm32/src/timer/pwm_input.rs index d34ba086f..d3fe7632a 100644 --- a/embassy-stm32/src/timer/pwm_input.rs +++ b/embassy-stm32/src/timer/pwm_input.rs @@ -1,4 +1,4 @@ -//! Input capture driver. +//! PWM Input driver. use embassy_hal_internal::into_ref; @@ -8,7 +8,7 @@ use crate::gpio::{AFType, Pull}; use crate::time::Hertz; use crate::Peripheral; -/// Input capture driver. +/// PWM Input driver. pub struct PwmInput<'d, T: GeneralInstance4Channel> { channel: Channel, inner: Timer<'d, T>, @@ -20,7 +20,7 @@ fn regs_gp16(ptr: *mut ()) -> crate::pac::timer::TimGp16 { } impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> { - /// Create a new input capture driver. + /// Create a new PWM input driver. pub fn new( tim: impl Peripheral

+ 'd, pin: impl Peripheral

> + 'd, @@ -37,7 +37,7 @@ impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> { Self::new_inner(tim, freq, Channel::Ch1, Channel::Ch2) } - /// Create a new input capture driver. + /// Create a new PWM input driver. pub fn new_alt( tim: impl Peripheral

+ 'd, pin: impl Peripheral

> + 'd, diff --git a/examples/stm32f1/src/bin/input_capture.rs b/examples/stm32f1/src/bin/input_capture.rs index 417830231..5e2dab9e6 100644 --- a/examples/stm32f1/src/bin/input_capture.rs +++ b/examples/stm32f1/src/bin/input_capture.rs @@ -43,7 +43,7 @@ async fn main(spawner: Spawner) { let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); loop { - info!("wait for risign edge"); + info!("wait for rising edge"); ic.wait_for_rising_edge(Channel::Ch3).await; let capture_value = ic.get_capture_value(Channel::Ch3); diff --git a/examples/stm32f1/src/bin/pwm_input.rs b/examples/stm32f1/src/bin/pwm_input.rs index c051d1328..de6949eb4 100644 --- a/examples/stm32f1/src/bin/pwm_input.rs +++ b/examples/stm32f1/src/bin/pwm_input.rs @@ -11,7 +11,7 @@ use embassy_stm32::{bind_interrupts, peripherals, timer}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; -/// Connect PB2 and PB10 with a 1k Ohm resistor +/// Connect PA0 and PC13 with a 1k Ohm resistor #[embassy_executor::task] async fn blinky(led: peripherals::PC13) { diff --git a/examples/stm32f4/src/bin/pwm_input.rs b/examples/stm32f4/src/bin/pwm_input.rs index eb1e7cb87..30cefac3a 100644 --- a/examples/stm32f4/src/bin/pwm_input.rs +++ b/examples/stm32f4/src/bin/pwm_input.rs @@ -11,7 +11,7 @@ use embassy_stm32::{bind_interrupts, peripherals, timer}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; -/// Connect PB2 and PB10 with a 1k Ohm resistor +/// Connect PB2 and PA6 with a 1k Ohm resistor #[embassy_executor::task] async fn blinky(led: peripherals::PB2) {