Merge pull request #3036 from Linjieqiang/fix_stm32hal_rtc_error

bsp: fix stm32 rtc hal library error.
This commit is contained in:
Bernard Xiong 2019-09-05 08:05:50 +08:00 committed by GitHub
commit 42248d81e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,9 @@ static rt_err_t rt_rtc_config(struct rt_device *dev)
#endif #endif
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
/* Enable RTC Clock */
__HAL_RCC_RTC_ENABLE();
RTC_Handler.Instance = RTC; RTC_Handler.Instance = RTC;
if (HAL_RTCEx_BKUPRead(&RTC_Handler, RTC_BKP_DR1) != BKUP_REG_DATA) if (HAL_RTCEx_BKUPRead(&RTC_Handler, RTC_BKP_DR1) != BKUP_REG_DATA)
{ {