diff options
| author | Bernard Xiong <[email protected]> | 2021-09-30 18:25:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-30 18:25:54 +0800 |
| commit | b60adb2d04764af446c9dbb5cc58846e70f0153f (patch) | |
| tree | 5abb2cb7bb76253a1d6b7258ebf685e357acba98 /components/libc | |
| parent | 1e36db0c382cc47276277f3b3e1911499070b750 (diff) | |
| parent | 3fafe6e8119806e2dc6efd46b946602213b8dc11 (diff) | |
Merge pull request #5113 from armink/fix_rtc
Fix rtc
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/common/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index f81844f8e9..24289088fb 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -101,7 +101,7 @@ static rt_err_t get_timeval(struct timeval *tv) if (rt_device_open(device, 0) == RT_EOK) { rst = rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME, &tv->tv_sec); - rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME_US, &tv->tv_usec); + rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIMEVAL, tv); rt_device_close(device); } } @@ -147,7 +147,7 @@ static int set_timeval(struct timeval *tv) if (rt_device_open(device, 0) == RT_EOK) { rst = rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIME, &tv->tv_sec); - rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIME_US, &tv->tv_usec); + rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIMEVAL, tv); rt_device_close(device); } } |
