aboutsummaryrefslogtreecommitdiff
path: root/libc/gettimeofday.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2015-11-11 14:46:28 -0500
committerPaul Selkirk <paul@psgd.org>2015-11-11 14:46:28 -0500
commit4c6b056b8467bb6513224527ff3120ef905de397 (patch)
treebb2cc71ae6931dce7327af54b17f42591aa16f75 /libc/gettimeofday.c
parentdf8f45c0d06e64b3901f1cce4e74cbde038737f2 (diff)
Lots of cleanup.
Clean up and simplify(?) Makefile. Add copyrights as needed. Add include guard to stm-fmc.h. Move MX_USART2_UART_Init back to stm-init.c for possible copyright reasons. Move libc, src, and include files to top level.
Diffstat (limited to 'libc/gettimeofday.c')
-rw-r--r--libc/gettimeofday.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/libc/gettimeofday.c b/libc/gettimeofday.c
deleted file mode 100644
index b0561c3..0000000
--- a/libc/gettimeofday.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdint.h>
-
-#include "stm32f4xx_hal.h"
-
-/* Don't #include <sys/time.h> because of conflicting prototype in newlib. */
-
-/* from the manpage: */
-struct timeval {
- time_t tv_sec; /* seconds */
- suseconds_t tv_usec; /* microseconds */
-};
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of DST correction */
-};
-
-int gettimeofday(struct timeval *tv, struct timezone *tz)
-{
- uint32_t tick = HAL_GetTick(); /* uptime in ms */
-
- tv->tv_sec = tick / 1000;
- tv->tv_usec = (tick % 1000) * 1000;
-
- return 0;
-}