Skip to content

Commit

Permalink
drivers: rtc: stm32: Updated scope of hsem
Browse files Browse the repository at this point in the history
This commit updates the scope of  hsem.

Signed-off-by: Petr Hlineny <[email protected]>
  • Loading branch information
coran21 authored and carlescufi committed Jan 4, 2024
1 parent 784a5b8 commit 0ed8f10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ static int rtc_stm32_init(const struct device *dev)
k_mutex_init(&data->lock);

/* Enable Backup access */
z_stm32_hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
#if defined(PWR_CR_DBP) || defined(PWR_CR1_DBP) || defined(PWR_DBPCR_DBP) || defined(PWR_DBPR_DBP)
LL_PWR_EnableBkUpAccess();
#endif /* PWR_CR_DBP || PWR_CR1_DBP || PWR_DBPR_DBP */
Expand All @@ -150,6 +149,8 @@ static int rtc_stm32_init(const struct device *dev)
return -EIO;
}

z_stm32_hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);

LL_RCC_EnableRTC();

z_stm32_hsem_unlock(CFG_HW_RCC_SEMID);
Expand Down

0 comments on commit 0ed8f10

Please sign in to comment.