From 9c261b76e82f7ba8eb12c6618c1eeefac2de9483 Mon Sep 17 00:00:00 2001 From: Ilia Sharin Date: Sun, 6 Aug 2017 19:14:48 -0400 Subject: [PATCH 1/2] Improved compatibility with various GCC-supported C language standards (like -std=c11) --- hardware.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware.c b/hardware.c index 716ed75..a6039ef 100644 --- a/hardware.c +++ b/hardware.c @@ -21,6 +21,7 @@ along with this program. If not, see . #include #include #include +#include #include "hardware.h" #include "user_io.h" @@ -52,9 +53,10 @@ void hexdump(void *data, uint16_t size, uint16_t offset) unsigned long GetTimer(unsigned long offset) { struct timespec tp; - clock_gettime(CLOCK_BOOTTIME, &tp); - unsigned long long res; + clock_gettime(CLOCK_BOOTTIME, &tp); + + int64_t res; res = tp.tv_sec; res *= 1000; From 30dacef8c954eaa85ddb1a7bfe73017ed1a1f8c5 Mon Sep 17 00:00:00 2001 From: Ilia Sharin Date: Mon, 7 Aug 2017 09:58:45 -0400 Subject: [PATCH 2/2] Switched to unsigned 64-bit type --- hardware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware.c b/hardware.c index a6039ef..d9989a1 100644 --- a/hardware.c +++ b/hardware.c @@ -56,7 +56,7 @@ unsigned long GetTimer(unsigned long offset) clock_gettime(CLOCK_BOOTTIME, &tp); - int64_t res; + uint64_t res; res = tp.tv_sec; res *= 1000;