diff options
| -rw-r--r-- | embassy-stm32/src/timer/input_capture.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/timer/input_capture.rs b/embassy-stm32/src/timer/input_capture.rs index 8d1a77867..0258d4077 100644 --- a/embassy-stm32/src/timer/input_capture.rs +++ b/embassy-stm32/src/timer/input_capture.rs | |||
| @@ -78,18 +78,18 @@ impl<'d, T: GeneralInstance4Channel> InputCapture<'d, T> { | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | fn new_inner(tim: impl Peripheral<P = T> + 'd, freq: Hertz, counting_mode: CountingMode) -> Self { | 80 | fn new_inner(tim: impl Peripheral<P = T> + 'd, freq: Hertz, counting_mode: CountingMode) -> Self { |
| 81 | let mut inner = Timer::new(tim); | 81 | let mut this = Self { inner: Timer::new(tim) }; |
| 82 | 82 | ||
| 83 | inner.set_counting_mode(counting_mode); | 83 | this.inner.set_counting_mode(counting_mode); |
| 84 | inner.set_tick_freq(freq); | 84 | this.inner.set_tick_freq(freq); |
| 85 | inner.enable_outputs(); // Required for advanced timers, see GeneralInstance4Channel for details | 85 | this.inner.enable_outputs(); // Required for advanced timers, see GeneralInstance4Channel for details |
| 86 | inner.start(); | 86 | this.inner.start(); |
| 87 | 87 | ||
| 88 | // enable NVIC interrupt | 88 | // enable NVIC interrupt |
| 89 | T::CaptureCompareInterrupt::unpend(); | 89 | T::CaptureCompareInterrupt::unpend(); |
| 90 | unsafe { T::CaptureCompareInterrupt::enable() }; | 90 | unsafe { T::CaptureCompareInterrupt::enable() }; |
| 91 | 91 | ||
| 92 | Self { inner } | 92 | this |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | /// Enable the given channel. | 95 | /// Enable the given channel. |
