Allow main to build when local debug flag is on

pull/2259/head
Tesfa Mael 2019-06-04 13:12:27 -07:00
parent af9d82963e
commit 4f80c7c94e
1 changed files with 5 additions and 6 deletions

View File

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