undo changes in input_capture

This commit is contained in:
Bruno Bousquet 2024-05-30 17:49:20 -04:00
parent 84707af5d7
commit 4d307b5a77

View file

@ -78,18 +78,18 @@ impl<'d, T: GeneralInstance4Channel> InputCapture<'d, T> {
} }
fn new_inner(tim: impl Peripheral<P = T> + 'd, freq: Hertz, counting_mode: CountingMode) -> Self { fn new_inner(tim: impl Peripheral<P = T> + 'd, freq: Hertz, counting_mode: CountingMode) -> Self {
let mut inner = Timer::new(tim); let mut this = Self { inner: Timer::new(tim) };
inner.set_counting_mode(counting_mode); this.inner.set_counting_mode(counting_mode);
inner.set_tick_freq(freq); this.inner.set_tick_freq(freq);
inner.enable_outputs(); // Required for advanced timers, see GeneralInstance4Channel for details this.inner.enable_outputs(); // Required for advanced timers, see GeneralInstance4Channel for details
inner.start(); this.inner.start();
// enable NVIC interrupt // enable NVIC interrupt
T::CaptureCompareInterrupt::unpend(); T::CaptureCompareInterrupt::unpend();
unsafe { T::CaptureCompareInterrupt::enable() }; unsafe { T::CaptureCompareInterrupt::enable() };
Self { inner } this
} }
/// Enable the given channel. /// Enable the given channel.