diff options
| author | Ralf <[email protected]> | 2023-10-13 17:38:40 +0200 |
|---|---|---|
| committer | Ralf <[email protected]> | 2023-10-13 17:38:40 +0200 |
| commit | adc810d24ba25972bb8c886fce9c67ec7de4ac00 (patch) | |
| tree | af834b915a7f181ca74ed29bb8cea1e77b1a68d7 /embassy-stm32/src/timer | |
| parent | 75baf186f3e5e3cf03e861d90a011f17f2f865f7 (diff) | |
STM32: Fix regression in advanced timer to enable output of PWM signal by partly reverting commit 74eb519
Diffstat (limited to 'embassy-stm32/src/timer')
| -rw-r--r-- | embassy-stm32/src/timer/mod.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 1e0999ed3..9f37b8054 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, _enable: bool); |
| 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(); |
| @@ -401,7 +401,9 @@ macro_rules! impl_32bit_timer { | |||
| 401 | #[allow(unused)] | 401 | #[allow(unused)] |
| 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) {} | ||
| 406 | } | ||
| 405 | }; | 407 | }; |
| 406 | } | 408 | } |
| 407 | 409 | ||
| @@ -450,7 +452,13 @@ foreach_interrupt! { | |||
| 450 | impl CaptureCompare16bitInstance for crate::peripherals::$inst {} | 452 | impl CaptureCompare16bitInstance for crate::peripherals::$inst {} |
| 451 | impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} | 453 | impl ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} |
| 452 | impl AdvancedControlInstance for crate::peripherals::$inst {} | 454 | impl AdvancedControlInstance for crate::peripherals::$inst {} |
| 453 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst {} | 455 | impl sealed::CaptureCompare16bitInstance for crate::peripherals::$inst { |
| 456 | fn enable_outputs(&mut self, enable: bool) { | ||
| 457 | use crate::timer::sealed::AdvancedControlInstance; | ||
| 458 | let r = Self::regs_advanced(); | ||
| 459 | r.bdtr().modify(|w| w.set_moe(enable)); | ||
| 460 | } | ||
| 461 | } | ||
| 454 | impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} | 462 | impl sealed::ComplementaryCaptureCompare16bitInstance for crate::peripherals::$inst {} |
| 455 | impl sealed::GeneralPurpose16bitInstance for crate::peripherals::$inst { | 463 | impl sealed::GeneralPurpose16bitInstance for crate::peripherals::$inst { |
| 456 | fn regs_gp16() -> crate::pac::timer::TimGp16 { | 464 | fn regs_gp16() -> crate::pac::timer::TimGp16 { |
