diff --git a/src/timer.rs b/src/timer.rs index 97bc9d28..30bce86c 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -498,6 +498,7 @@ macro_rules! split { ($(PwmChannelDisabled::<_, $C>::new(),)+) } } + #[cfg(not(feature = "gpio-f410"))] impl SplitCapture for $TIM { type CaptureChannels = ($(CaptureChannelDisabled<$TIM, $C>,)+); fn split_capture() -> Self::CaptureChannels { diff --git a/src/timer/capture.rs b/src/timer/capture.rs index 02bfdbf2..4576a40b 100644 --- a/src/timer/capture.rs +++ b/src/timer/capture.rs @@ -5,7 +5,7 @@ //! Timer::new(dp.TIM5, &clocks).capture_hz(24.MHz()); //! ``` //! In the `capture_hz` method, the desired timer counter frequency is specified. -//! For high accuracy, it is recommended to use 32-bit timers (TIM2, TIM5) and to select the highest possible frequency, ideally the maximum frequency equal to the timer's clock frequency. +//! For high accuracy, it is recommended to use 32-bit timers (TIM2, TIM5) and to select the highest possible frequency, ideally the maximum frequency equal to the timer's clock frequency. //! This returns a `CaptureHzManager` and a tuple of all `CaptureChannel`s supported by the timer. Additionally, the [`CaptureExt`] trait is implemented for `pac::TIMx` to simplify the creation of a new structure. //! //! ```rust,ignore @@ -102,32 +102,14 @@ where self.tim.preload_capture(C, CaptureMode::InputCapture); CaptureChannel { tim: self.tim, - lines: CaptureLines::One(pin.into()), - } - } -} - -#[derive(Debug)] -pub enum CaptureLines
{ - One(P), - Two(P, P), - Three(P, P, P), - Four(P, P, P, P), -} -impl
CaptureLines
{
- pub fn and(self, pin: P) -> Self {
- match self {
- Self::One(p) => Self::Two(p, pin),
- Self::Two(p1, p2) => Self::Three(p1, p2, pin),
- Self::Three(p1, p2, p3) => Self::Four(p1, p2, p3, pin),
- Self::Four(_, _, _, _) => unreachable!(),
+ pin: pin.into(),
}
}
}
pub struct CaptureChannel