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


The following commit(s) were added to refs/heads/master by this push:
     new c9e1d65bf stm32/hal: Fix STM32H7 with RTC as system tick
c9e1d65bf is described below

commit c9e1d65bfbe6e9f0ca345487b4b9cc0b70a255a3
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Sat May 18 22:35:35 2024 +0200

    stm32/hal: Fix STM32H7 with RTC as system tick
    
    STM32H7 HAL has __HAL_RCC_RTC_CLK_ENABLE macro for
    turning on RTC clock.
    Some other MCUs also have this and for historical reasons
    have __HAL_RCC_RTCAPB_CLK_ENABLE that is an alias.
    Other only have __HAL_RCC_RTCAPB_CLK_ENABLE.
    
    This uses __HAL_RCC_RTC_CLK_ENABLE() if defined to enable
    RTC clock in RCC.
---
 hw/mcu/stm/stm32_common/src/hal_os_tick.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/mcu/stm/stm32_common/src/hal_os_tick.c 
b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
index 1b167092c..fa7d14fda 100644
--- a/hw/mcu/stm/stm32_common/src/hal_os_tick.c
+++ b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
@@ -324,6 +324,8 @@ os_tick_init(uint32_t os_ticks_per_sec, int prio)
 
 #ifdef __HAL_RCC_RTCAPB_CLK_ENABLE
     __HAL_RCC_RTCAPB_CLK_ENABLE();
+#elif defined(__HAL_RCC_RTC_CLK_ENABLE)
+    __HAL_RCC_RTC_CLK_ENABLE();
 #endif
 #ifdef __HAL_RCC_RTCAPB_CLKAM_ENABLE
     __HAL_RCC_RTCAPB_CLKAM_ENABLE();

Reply via email to