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

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

commit a3b90ae954da3115d0d157feda72a4f14423cae1
Author: Wiktor Kwiatkowski <[email protected]>
AuthorDate: Wed Apr 15 10:51:54 2026 +0200

    drivers/pwm_stm32: Fix build for STM32G0
    
    Added conditional compilation to check if TIM14 is connected to
    APB1 or APB2.
---
 hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c 
b/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
index 1e02812f1..72e1724c8 100644
--- a/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
+++ b/hw/drivers/pwm/pwm_stm32/src/pwm_stm32.c
@@ -541,7 +541,11 @@ stm32_pwm_dev_init(struct os_dev *odev, void *arg)
 #endif
 #ifdef TIM14
     case (uintptr_t)TIM14:
+#if defined(LL_APB2_GRP1_PERIPH_TIM14)
+        LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM14);
+#elif defined(LL_APB1_GRP1_PERIPH_TIM14)
         LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM14);
+#endif
         dev->pwm_chan_count = 1;
         break;
 #endif

Reply via email to