From 4e66a20fbf9824dd01331e9f381de97f658969c5 Mon Sep 17 00:00:00 2001 From: leton-tian <65377215+leton-tian@users.noreply.github.com> Date: Thu, 10 Jun 2021 22:23:06 +0800 Subject: [PATCH] Update drv_rtc.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将rt_int32_t改为time_t。 --- bsp/bluetrum/libraries/hal_drivers/drv_rtc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c b/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c index ccbaac1909..9107107ab0 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c @@ -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; }