STM32: timer enable_output does not take bool, but just enables the output

This commit is contained in:
Ralf 2023-10-13 18:50:54 +02:00
parent adc810d24b
commit 9a7fda87b0
3 changed files with 6 additions and 6 deletions

View File

@ -71,7 +71,7 @@ impl<'d, T: ComplementaryCaptureCompare16bitInstance> ComplementaryPwm<'d, T> {
this.inner.set_frequency(freq); this.inner.set_frequency(freq);
this.inner.start(); this.inner.start();
this.inner.enable_outputs(true); this.inner.enable_outputs();
this.inner this.inner
.set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1);

View File

@ -173,7 +173,7 @@ pub(crate) mod sealed {
} }
}); });
} }
fn enable_outputs(&mut self, _enable: bool); fn enable_outputs(&mut self);
fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) {
let r = Self::regs_gp16(); let r = Self::regs_gp16();
@ -402,7 +402,7 @@ macro_rules! impl_32bit_timer {
macro_rules! impl_compare_capable_16bit { macro_rules! impl_compare_capable_16bit {
($inst:ident) => { ($inst:ident) => {
impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst {
fn enable_outputs(&mut self, _enable: bool) {} fn enable_outputs(&mut self) {}
} }
}; };
} }
@ -453,10 +453,10 @@ foreach_interrupt! {
impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {}
impl AdvancedControlInstance for crate::peripherals::$inst {} impl AdvancedControlInstance for crate::peripherals::$inst {}
impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst {
fn enable_outputs(&mut self, enable: bool) { fn enable_outputs(&mut self) {
use crate::timer::sealed::AdvancedControlInstance; use crate::timer::sealed::AdvancedControlInstance;
let r = Self::regs_advanced(); let r = Self::regs_advanced();
r.bdtr().modify(|w| w.set_moe(enable)); r.bdtr().modify(|w| w.set_moe(true));
} }
} }
impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {}

View File

@ -70,7 +70,7 @@ impl<'d, T: CaptureCompare16bitInstance> SimplePwm<'d, T> {
this.inner.set_frequency(freq); this.inner.set_frequency(freq);
this.inner.start(); this.inner.start();
this.inner.enable_outputs(true); this.inner.enable_outputs();
this.inner this.inner
.set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1);