From 4f80c7c94e692f265568e9071e7f12a47f8a1db6 Mon Sep 17 00:00:00 2001 From: Tesfa Mael Date: Tue, 4 Jun 2019 13:12:27 -0700 Subject: [PATCH] Allow main to build when local debug flag is on --- IDE/ECLIPSE/SIFIVE/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/IDE/ECLIPSE/SIFIVE/main.c b/IDE/ECLIPSE/SIFIVE/main.c index 4b0e3e7a2..99369e33e 100644 --- a/IDE/ECLIPSE/SIFIVE/main.c +++ b/IDE/ECLIPSE/SIFIVE/main.c @@ -69,17 +69,16 @@ void check(int depth) { free(ptr); } -void mtime_sleep(uint64_t ticks) { - uint64_t now = CLINT_REG_MTIME; - uint64_t then = now + ticks; +void mtime_sleep(uint32_t ticks) { + uint32_t start = CLINT_REG_MTIME; - while((*mtime - now) < ticks) { + while((CLINT_REG_MTIME - start) < ticks) { } } -void delay(int sec) { - uint64_t ticks = sec * RTC_FREQ; +void delay(uint32_t sec) { + uint32_t ticks = sec * RTC_FREQ; mtime_sleep(ticks); } #endif /* WOLFSSL_SIFIVE_RISC_V_DEBUG */