未验证 提交 56a65431 编写于 作者: H HubretXie 提交者: GitHub

Update drv_rtc.c

rtc选用lsi时不工作
上级 5a5ea949
......@@ -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.
先完成此消息的编辑!
想要评论请 注册