diff options
| author | Bruno Bousquet <[email protected]> | 2024-05-30 17:49:20 -0400 |
|---|---|---|
| committer | Bruno Bousquet <[email protected]> | 2024-05-30 17:49:20 -0400 |
| commit | 4d307b5a7763a2d38de201bdef787bee07afe022 (patch) | |
| tree | 84c292a0b24985fae73d560fba624ef3f523da76 /embassy-stm32/src/timer | |
| parent | 84707af5d7f3e62caafed06c416cf12fa82e4664 (diff) | |
undo changes in input_capture
Diffstat (limited to 'embassy-stm32/src/timer')
| -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. |
