소스 검색

Merge pull request #731 from ArdaFu/master

[libc] Add dummy _gettimeofday function when hardware do not have the…
Bernard Xiong 8 년 전
부모
커밋
5b73dfa0d5
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      components/libc/minilibc/time.c

+ 10 - 0
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