Merge pull request #2053 from jr-oss/fix_stm32_advanced_timer_enable_output
STM32: Fix regression in advanced timer to enable output of PWM signa…
This commit is contained in:
commit
575db17264
@ -71,7 +71,7 @@ impl<'d, T: ComplementaryCaptureCompare16bitInstance> ComplementaryPwm<'d, T> {
|
||||
this.inner.set_frequency(freq);
|
||||
this.inner.start();
|
||||
|
||||
this.inner.enable_outputs(true);
|
||||
this.inner.enable_outputs();
|
||||
|
||||
this.inner
|
||||
.set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1);
|
||||
|
@ -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) {
|
||||
let r = Self::regs_gp16();
|
||||
@ -401,7 +401,9 @@ macro_rules! impl_32bit_timer {
|
||||
#[allow(unused)]
|
||||
macro_rules! impl_compare_capable_16bit {
|
||||
($inst:ident) => {
|
||||
impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst {}
|
||||
impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst {
|
||||
fn enable_outputs(&mut self) {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -450,7 +452,13 @@ foreach_interrupt! {
|
||||
impl CaptureCompare16bitInstance for crate::peripherals::$inst {}
|
||||
impl ComplementaryCaptureCompare16bitInstance 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) {
|
||||
use crate::timer::sealed::AdvancedControlInstance;
|
||||
let r = Self::regs_advanced();
|
||||
r.bdtr().modify(|w| w.set_moe(true));
|
||||
}
|
||||
}
|
||||
impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {}
|
||||
impl sealed::GeneralPurpose16bitInstance for crate::peripherals::$inst {
|
||||
fn regs_gp16() -> crate::pac::timer::TimGp16 {
|
||||
|
@ -70,7 +70,7 @@ impl<'d, T: CaptureCompare16bitInstance> SimplePwm<'d, T> {
|
||||
this.inner.set_frequency(freq);
|
||||
this.inner.start();
|
||||
|
||||
this.inner.enable_outputs(true);
|
||||
this.inner.enable_outputs();
|
||||
|
||||
this.inner
|
||||
.set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1);
|
||||
|
Loading…
Reference in New Issue
Block a user