Use time_t for RT_DEVICE_CTRL_RTC_GET_TIME RT_DEVICE_CTRL_RTC_SET_TIME

This commit is contained in:
Yonggang Luo
2025-09-27 08:20:12 +08:00
committed by R b b666
parent 5ae232b6d0
commit b2d6e2c268
10 changed files with 18 additions and 18 deletions

View File

@@ -64,16 +64,16 @@ static rt_err_t rt_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_timestamp();
LOG_D("RTC: get rtc_time %x\n", *(rt_uint32_t *)args);
*(time_t *)args = get_rtc_timestamp();
LOG_D("RTC: get rtc_time %x\n", *(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\n", *(rt_uint32_t *)args);
LOG_D("RTC: set rtc_time %x\n", *(time_t *)args);
break;
}