diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 9739a595b..6f28d04bb 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -299,7 +299,9 @@ void chSchDoRescheduleBehind(void) { /* Picks the first thread from the ready queue and makes it current.*/ setcurrp(fifo_remove(&rlist.r_queue)); currp->p_state = THD_STATE_CURRENT; +#if CH_TIME_QUANTUM > 0 otp->p_preempt = CH_TIME_QUANTUM; +#endif chSchReadyI(otp); chSysSwitch(currp, otp); }