summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-05-17 16:36:34 +0800
committerarmink <[email protected]>2019-05-17 17:07:14 +0800
commitbf4a51b599b56cddb93f7f2ad576f6f0d022a64e (patch)
treee9c54e3d37a1d3342d1bf19c44384b6c38703fac /components/libc/compilers/dlib
parent94e3f77f25249b52c6f72921a2d2564f68bcd6ff (diff)
Update the kernel and components to master version.
Diffstat (limited to 'components/libc/compilers/dlib')
-rw-r--r--components/libc/compilers/dlib/time.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/components/libc/compilers/dlib/time.c b/components/libc/compilers/dlib/time.c
index 87574df851..df35313b0e 100644
--- a/components/libc/compilers/dlib/time.c
+++ b/components/libc/compilers/dlib/time.c
@@ -16,19 +16,16 @@ int gettimeofday(struct timeval *tp, void *ignore)
rt_device_t device;
device = rt_device_find("rtc");
- if (device != RT_NULL)
- {
- rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME, &time);
- if (tp != RT_NULL)
- {
- tp->tv_sec = time;
- tp->tv_usec = 0;
- }
+ RT_ASSERT(device != RT_NULL);
- return time;
+ rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME, &time);
+ if (tp != RT_NULL)
+ {
+ tp->tv_sec = time;
+ tp->tv_usec = 0;
}
- return 0;
+ return time;
}
#endif