X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=FreeRTOS%2FDemo%2FRISC-V_RV32_SiFive_HiFive1_FreedomStudio%2Ffreedom-metal%2Fgloss%2Fsys_gettimeofday.c;h=409b2ce2f2906fb695483a4a6f49c6c244ee72da;hb=3bcd0c8a9d1b399c59475115322cbb93484e66d2;hp=3f867e4eb73119ee7f2ecca9907199afc3682b8a;hpb=06d74d96f574509835f17691b1919f2562989484;p=freertos diff --git a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/gloss/sys_gettimeofday.c b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/gloss/sys_gettimeofday.c index 3f867e4eb..409b2ce2f 100644 --- a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/gloss/sys_gettimeofday.c +++ b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/gloss/sys_gettimeofday.c @@ -7,10 +7,12 @@ _gettimeofday(struct timeval *tp, void *tzp) { int rv; unsigned long long mcc, timebase; - if (rv = metal_timer_get_cyclecount(0, &mcc)) { + rv = metal_timer_get_cyclecount(0, &mcc); + if (rv != 0) { return -1; } - if (rv = metal_timer_get_timebase_frequency(0, &timebase)) { + rv = metal_timer_get_timebase_frequency(0, &timebase); + if (rv != 0) { return -1; } tp->tv_sec = mcc / timebase;