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 */