未验证 提交 4e66a20f 编写于 作者: L leton-tian 提交者: GitHub

Update drv_rtc.c

将rt_int32_t改为time_t。
上级 a52e147c
......@@ -189,27 +189,27 @@ static rt_err_t ab32_rtc_control(rt_device_t dev, int cmd, void *args)
switch (cmd)
{
case RT_DEVICE_CTRL_RTC_GET_TIME:
*(rt_uint32_t *)args = get_rtc_time_stamp();
LOG_D("RTC: get rtc_time %x", *(rt_uint32_t *)args);
*(time_t *)args = get_rtc_time_stamp();
LOG_D("RTC: get rtc_time %x", *(time_t *)args);
break;
case RT_DEVICE_CTRL_RTC_SET_TIME:
if (set_rtc_time_stamp(*(rt_uint32_t *)args))
if (set_rtc_time_stamp(*(time_t *)args))
{
result = -RT_ERROR;
}
LOG_D("RTC: set rtc_time %x", *(rt_uint32_t *)args);
LOG_D("RTC: set rtc_time %x", *(time_t *)args);
break;
case RT_DEVICE_CTRL_RTC_SET_ALARM:
if (set_rtc_alarm_stamp(*(rt_uint32_t *)args))
if (set_rtc_alarm_stamp(*(time_t *)args))
{
result = -RT_ERROR;
}
LOG_D("RTC: set alarm_stamp %x", *(rt_uint32_t *)args);
LOG_D("RTC: set alarm_stamp %x", *(time_t *)args);
break;
case RT_DEVICE_CTRL_RTC_GET_ALARM:
*(rt_uint32_t *)args = get_rtc_alarm_stamp();
LOG_D("RTC: get alarm_stamp %x", *(rt_uint32_t *)args);
*(time_t *)args = get_rtc_alarm_stamp();
LOG_D("RTC: get alarm_stamp %x", *(time_t *)args);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册