Fixed a comments and added an extra check.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10953 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
66905f3fb2
commit
e2365fc47b
|
@ -178,6 +178,9 @@ void chVTDoSetI(virtual_timer_t *vtp, sysinterval_t delay,
|
||||||
/* The delta list is scanned in order to find the correct position for
|
/* The delta list is scanned in order to find the correct position for
|
||||||
this timer. */
|
this timer. */
|
||||||
while (p->delta < delta) {
|
while (p->delta < delta) {
|
||||||
|
/* Debug assert if the timer is already in the list.*/
|
||||||
|
chDbgAssert(p != vtp, "timer already armed");
|
||||||
|
|
||||||
delta -= p->delta;
|
delta -= p->delta;
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
@ -187,11 +190,13 @@ void chVTDoSetI(virtual_timer_t *vtp, sysinterval_t delay,
|
||||||
vtp->prev = vtp->next->prev;
|
vtp->prev = vtp->next->prev;
|
||||||
vtp->prev->next = vtp;
|
vtp->prev->next = vtp;
|
||||||
p->prev = vtp;
|
p->prev = vtp;
|
||||||
vtp->delta = delta
|
vtp->delta = delta;
|
||||||
|
|
||||||
|
/* Calculate new delta for the following entry.*/
|
||||||
|
p->delta -= delta;
|
||||||
|
|
||||||
/* Special case when the timer is in last position in the list, the
|
/* Special case when the timer is in last position in the list, the
|
||||||
value in the header must be restored.*/;
|
value in the header must be restored.*/
|
||||||
p->delta -= delta;
|
|
||||||
ch.vtlist.delta = (sysinterval_t)-1;
|
ch.vtlist.delta = (sysinterval_t)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue