Merge pull request #2760 from HubertXie/master

[bsp][stm32]修复RTC选用LSI时不工作问题
This commit is contained in:
Bernard Xiong 2019-06-13 22:52:11 +08:00 committed by GitHub
commit 0d717a48d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -44,16 +44,10 @@ static time_t get_rtc_timestamp(void)
static rt_err_t set_rtc_time_stamp(time_t time_stamp)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
RTC_TimeTypeDef RTC_TimeStruct = {0};
RTC_DateTypeDef RTC_DateStruct = {0};
struct tm *p_tm;
HAL_PWR_EnableBkUpAccess();
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
p_tm = localtime(&time_stamp);
if (p_tm->tm_year < 100)
{