diff options
| author | Ralf <[email protected]> | 2023-10-13 18:50:54 +0200 |
|---|---|---|
| committer | Ralf <[email protected]> | 2023-10-13 18:52:10 +0200 |
| commit | 9a7fda87b0335471e2944a57af684cf4b184ce07 (patch) | |
| tree | e7a2b587b9c79bf1aadcbb9f9f28ea3334e83d87 | |
| parent | adc810d24ba25972bb8c886fce9c67ec7de4ac00 (diff) | |
STM32: timer enable_output does not take bool, but just enables the output
| -rw-r--r-- | embassy-stm32/src/timer/complementary_pwm.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/timer/mod.rs | 8 | ||||
| -rw-r--r-- | embassy-stm32/src/timer/simple_pwm.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/timer/complementary_pwm.rs b/embassy-stm32/src/timer/complementary_pwm.rs index 9349a6fad..e1baf6b2e 100644 --- a/embassy-stm32/src/timer/complementary_pwm.rs +++ b/embassy-stm32/src/timer/complementary_pwm.rs | |||
| @@ -71,7 +71,7 @@ impl<'d, T: ComplementaryCaptureCompare16bitInstance> ComplementaryPwm<'d, T> { | |||
| 71 | this.inner.set_frequency(freq); | 71 | this.inner.set_frequency(freq); |
| 72 | this.inner.start(); | 72 | this.inner.start(); |
| 73 | 73 | ||
| 74 | this.inner.enable_outputs(true); | 74 | this.inner.enable_outputs(); |
| 75 | 75 | ||
| 76 | this.inner | 76 | this.inner |
| 77 | .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); | 77 | .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); |
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 9f37b8054..4b88834cb 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs | |||
| @@ -173,7 +173,7 @@ pub(crate) mod sealed { | |||
| 173 | } | 173 | } |
| 174 | }); | 174 | }); |
| 175 | } | 175 | } |
| 176 | fn enable_outputs(&mut self, _enable: bool); | 176 | fn enable_outputs(&mut self); |
| 177 | 177 | ||
| 178 | fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { | 178 | fn set_output_compare_mode(&mut self, channel: Channel, mode: OutputCompareMode) { |
| 179 | let r = Self::regs_gp16(); | 179 | let r = Self::regs_gp16(); |
| @@ -402,7 +402,7 @@ macro_rules! impl_32bit_timer { | |||
| 402 | macro_rules! impl_compare_capable_16bit { | 402 | macro_rules! impl_compare_capable_16bit { |
| 403 | ($inst:ident) => { | 403 | ($inst:ident) => { |
| 404 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { | 404 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { |
| 405 | fn enable_outputs(&mut self, _enable: bool) {} | 405 | fn enable_outputs(&mut self) {} |
| 406 | } | 406 | } |
| 407 | }; | 407 | }; |
| 408 | } | 408 | } |
| @@ -453,10 +453,10 @@ foreach_interrupt! { | |||
| 453 | impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} | 453 | impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} |
| 454 | impl AdvancedControlInstance for crate::peripherals::$inst {} | 454 | impl AdvancedControlInstance for crate::peripherals::$inst {} |
| 455 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { | 455 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { |
| 456 | fn enable_outputs(&mut self, enable: bool) { | 456 | fn enable_outputs(&mut self) { |
| 457 | use crate::timer::sealed::AdvancedControlInstance; | 457 | use crate::timer::sealed::AdvancedControlInstance; |
| 458 | let r = Self::regs_advanced(); | 458 | let r = Self::regs_advanced(); |
| 459 | r.bdtr().modify(|w| w.set_moe(enable)); | 459 | r.bdtr().modify(|w| w.set_moe(true)); |
| 460 | } | 460 | } |
| 461 | } | 461 | } |
| 462 | impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} | 462 | impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} |
diff --git a/embassy-stm32/src/timer/simple_pwm.rs b/embassy-stm32/src/timer/simple_pwm.rs index 18ecc1964..01773ff3a 100644 --- a/embassy-stm32/src/timer/simple_pwm.rs +++ b/embassy-stm32/src/timer/simple_pwm.rs | |||
| @@ -70,7 +70,7 @@ impl<'d, T: CaptureCompare16bitInstance> SimplePwm<'d, T> { | |||
| 70 | this.inner.set_frequency(freq); | 70 | this.inner.set_frequency(freq); |
| 71 | this.inner.start(); | 71 | this.inner.start(); |
| 72 | 72 | ||
| 73 | this.inner.enable_outputs(true); | 73 | this.inner.enable_outputs(); |
| 74 | 74 | ||
| 75 | this.inner | 75 | this.inner |
| 76 | .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); | 76 | .set_output_compare_mode(Channel::Ch1, OutputCompareMode::PwmMode1); |
