mcs: Fix time consumed time overflow case

We must store the consumed time in us rather than in ticks into message
registers. In the overflow case, the time being stored was the maximum
US time in ticks, this fix converts it to US before being stored.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
This commit is contained in:
Curtis Millar
2020-10-07 12:37:21 +11:00
committed by Curtis Millar
parent 7e1047af05
commit 1db081075b

View File

@@ -363,7 +363,7 @@ time_t schedContext_updateConsumed(sched_context_t *sc)
ticks_t consumed = sc->scConsumed;
if (consumed >= getMaxTicksToUs()) {
sc->scConsumed -= getMaxTicksToUs();
return getMaxTicksToUs();
return ticksToUs(getMaxTicksToUs());
} else {
sc->scConsumed = 0;
return ticksToUs(consumed);