mcs: Fix conversion of ticks to us on aarch64

Actually divide by KHz frequency when on a platform that uses a clock
that does not have an integer MHz frequency for aarch64.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
This commit is contained in:
Curtis Millar 2020-09-09 10:12:48 +10:00 committed by Oliver Scott
parent 7749b33589
commit 7afebd31ee

View file

@ -24,7 +24,7 @@ static inline CONST ticks_t getMaxTicksToUs(void)
static inline CONST time_t ticksToUs(ticks_t ticks)
{
#if USE_KHZ
return (ticks * TIMER_CLOCK_KHZ) / TIMER_CLOCK_MHZ;
return (ticks * KHZ_IN_MHZ) / TIMER_CLOCK_KHZ;
#else
return ticks / TIMER_CLOCK_MHZ;
#endif