Fix getMaxUsToTicks function in RISC-V timer.h

The getMaxUsToTicks function is supposed to return maximum
amount of time you can pass to usToTicks without overflow,
but in RISC-V implementation it returns ticks instead. This
patch corrects it so it's implementation is akin to those in
other platforms.

Signed-off-by: Marcin Witkowski <mwitkowski@antmicro.com>
This commit is contained in:
Marcin Witkowski
2021-11-30 15:12:26 +01:00
committed by Gerwin Klein
parent 9401827d2f
commit b9a8967954

View File

@@ -39,12 +39,12 @@ static inline PURE ticks_t getTimerPrecision(void)
static inline CONST ticks_t getMaxTicksToUs(void)
{
return UINT64_MAX / TICKS_IN_US;
return UINT64_MAX;
}
static inline PURE time_t getMaxUsToTicks(void)
static inline CONST time_t getMaxUsToTicks(void)
{
return usToTicks(getMaxTicksToUs());
return UINT64_MAX / TICKS_IN_US;
}
/* Read the current time from the timer. */