You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/09/02 10:22:40 UTC

[mynewt-core] 01/02: pwm/stm32_pwm: Enable MOE for advanced pwm timers

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 3ecdc758d587b3630af50cc14dd35dc07696da26
Author: JustineKH <ju...@juul.com>
AuthorDate: Wed Sep 1 22:24:29 2021 -0700

    pwm/stm32_pwm: Enable MOE for advanced pwm timers
---
 hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c b/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
index 4d68f59..f4ffe7f 100644
--- a/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
+++ b/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
@@ -618,5 +618,12 @@ stm32_pwm_dev_init(struct os_dev *odev, void *arg)
     LL_TIM_CC_EnablePreload(cfg->tim);
     LL_TIM_SetCounter(pwm->timx, 0);
 
+    /* If using advanced timer, enable main output (MOE). */
+#ifdef IS_TIM_BREAK_INSTANCE
+    if (IS_TIM_BREAK_INSTANCE(pwm->timx)) {
+        LL_TIM_EnableAllOutputs(pwm->timx);
+    }
+#endif
+
     return STM32_PWM_ERR_OK;
 }