diff options
| author | Bruno Bousquet <[email protected]> | 2024-05-29 09:14:05 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-29 09:14:05 -0400 |
| commit | a23fa8dcb2e22ed2d8bac15fd875dfe53af43eda (patch) | |
| tree | 2a81baa9d8164366c6d264de0bde97e4b3515509 | |
| parent | 7f4803ddaf8f6eeeec45418f23b092bff95222d2 (diff) | |
Apply suggestions from code review
Co-authored-by: Romain Reignier <[email protected]>
| -rw-r--r-- | embassy-stm32/src/timer/pwm_input.rs | 8 | ||||
| -rw-r--r-- | examples/stm32f1/src/bin/input_capture.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f1/src/bin/pwm_input.rs | 2 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | //! Input capture driver. | 1 | //! PWM Input driver. |
| 2 | 2 | ||
| 3 | use embassy_hal_internal::into_ref; | 3 | use embassy_hal_internal::into_ref; |
| 4 | 4 | ||
| @@ -8,7 +8,7 @@ use crate::gpio::{AFType, Pull}; | |||
| 8 | use crate::time::Hertz; | 8 | use crate::time::Hertz; |
| 9 | use crate::Peripheral; | 9 | use crate::Peripheral; |
| 10 | 10 | ||
| 11 | /// Input capture driver. | 11 | /// PWM Input driver. |
| 12 | pub struct PwmInput<'d, T: GeneralInstance4Channel> { | 12 | pub struct PwmInput<'d, T: GeneralInstance4Channel> { |
| 13 | channel: Channel, | 13 | channel: Channel, |
| 14 | inner: Timer<'d, T>, | 14 | inner: Timer<'d, T>, |
| @@ -20,7 +20,7 @@ fn regs_gp16(ptr: *mut ()) -> crate::pac::timer::TimGp16 { | |||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> { | 22 | impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> { |
| 23 | /// Create a new input capture driver. | 23 | /// Create a new PWM input driver. |
| 24 | pub fn new( | 24 | pub fn new( |
| 25 | tim: impl Peripheral<P = T> + 'd, | 25 | tim: impl Peripheral<P = T> + 'd, |
| 26 | pin: impl Peripheral<P = impl Channel1Pin<T>> + 'd, | 26 | pin: impl Peripheral<P = impl Channel1Pin<T>> + 'd, |
| @@ -37,7 +37,7 @@ impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> { | |||
| 37 | Self::new_inner(tim, freq, Channel::Ch1, Channel::Ch2) | 37 | Self::new_inner(tim, freq, Channel::Ch1, Channel::Ch2) |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | /// Create a new input capture driver. | 40 | /// Create a new PWM input driver. |
| 41 | pub fn new_alt( | 41 | pub fn new_alt( |
| 42 | tim: impl Peripheral<P = T> + 'd, | 42 | tim: impl Peripheral<P = T> + 'd, |
| 43 | pin: impl Peripheral<P = impl Channel2Pin<T>> + 'd, | 43 | pin: impl Peripheral<P = impl Channel2Pin<T>> + '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) { | |||
| 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); | 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); |
| 44 | 44 | ||
| 45 | loop { | 45 | loop { |
| 46 | info!("wait for risign edge"); | 46 | info!("wait for rising edge"); |
| 47 | ic.wait_for_rising_edge(Channel::Ch3).await; | 47 | ic.wait_for_rising_edge(Channel::Ch3).await; |
| 48 | 48 | ||
| 49 | let capture_value = ic.get_capture_value(Channel::Ch3); | 49 | 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}; | |||
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | /// Connect PB2 and PB10 with a 1k Ohm resistor | 14 | /// Connect PA0 and PC13 with a 1k Ohm resistor |
| 15 | 15 | ||
| 16 | #[embassy_executor::task] | 16 | #[embassy_executor::task] |
| 17 | async fn blinky(led: peripherals::PC13) { | 17 | 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}; | |||
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | /// Connect PB2 and PB10 with a 1k Ohm resistor | 14 | /// Connect PB2 and PA6 with a 1k Ohm resistor |
| 15 | 15 | ||
| 16 | #[embassy_executor::task] | 16 | #[embassy_executor::task] |
| 17 | async fn blinky(led: peripherals::PB2) { | 17 | async fn blinky(led: peripherals::PB2) { |
