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

@@ -110,14 +110,14 @@ static rt_err_t rt_rtc_control(rt_device_t dev, int cmd, void *args)
{
case RT_DEVICE_CTRL_RTC_GET_TIME:
*(rt_uint32_t *)args = get_timestamp();
rtc_debug("RTC: get rtc_time %x\n", *(rt_uint32_t *)args);
*(time_t *)args = get_timestamp();
rtc_debug("RTC: get rtc_time %x\n", *(time_t *)args);
break;
case RT_DEVICE_CTRL_RTC_SET_TIME:
{
result = set_timestamp(*(rt_uint32_t *)args);
rtc_debug("RTC: set rtc_time %x\n", *(rt_uint32_t *)args);
result = set_timestamp(*(time_t *)args);
rtc_debug("RTC: set rtc_time %x\n", *(time_t *)args);
}
break;
}