summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorArdaFu <[email protected]>2017-05-05 17:50:51 +0800
committerArdaFu <[email protected]>2017-05-05 17:52:39 +0800
commit707540a8d3803f229efa431eb8915ddfc1d284e8 (patch)
treef31f25fb5b7a8b71975a275b0d1efc15e3371e1b /components
parentc65fc024279d7475fa79441d8f06b74f1d6a7460 (diff)
[libc] Add dummy _gettimeofday function when hardware do not have the RTC.
Diffstat (limited to 'components')
-rw-r--r--components/libc/minilibc/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/libc/minilibc/time.c b/components/libc/minilibc/time.c
index 8faa3e0470..efd6be8754 100644
--- a/components/libc/minilibc/time.c
+++ b/components/libc/minilibc/time.c
@@ -217,3 +217,13 @@ int gettimeofday(struct timeval *tp, void *ignore)
return 0;
}
#endif
+
+#ifndef _gettimeofday
+/* Dummy function when hardware do not have RTC */
+int _gettimeofday( struct timeval *tv, void *ignore)
+{
+ tv->tv_sec = 0; // convert to seconds
+ tv->tv_usec = 0; // get remaining microseconds
+ return 0; // return non-zero for error
+}
+#endif