未验证 提交 0d717a48 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #2760 from HubertXie/master

[bsp][stm32]修复RTC选用LSI时不工作问题
......@@ -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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册