drivers: rtc: stm32: Updated scope of hsem
This commit updates the scope of hsem. Signed-off-by: Petr Hlineny <development@hlineny.cz>
This commit is contained in:
parent
784a5b82e7
commit
0ed8f10d8a
1 changed files with 2 additions and 1 deletions
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue