Removed assertion for repeated tickless timer stop. Improved comments in virtual timers.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7550 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2014-11-30 10:09:38 +00:00
parent 2a7ff56334
commit 5b59f89d98
2 changed files with 9 additions and 4 deletions

View File

@ -94,8 +94,6 @@ void stStartAlarm(systime_t time) {
*/
void stStopAlarm(void) {
osalDbgAssert(stIsAlarmActive() != false, "not active");
st_lld_stop_alarm();
}

View File

@ -468,12 +468,19 @@ static inline void chVTDoTickI(void) {
systime_t delta = now - ch.vtlist.vt_lasttime;
while ((vtp = ch.vtlist.vt_next)->vt_delta <= delta) {
vtfunc_t fn;
/* The "last time" becomes this timer's expiration time.*/
delta -= vtp->vt_delta;
ch.vtlist.vt_lasttime += vtp->vt_delta;
vtfunc_t fn = vtp->vt_func;
vtp->vt_func = (vtfunc_t)NULL;
/* The timer is removed from the list and marked as non-armed.*/
vtp->vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist;
ch.vtlist.vt_next = vtp->vt_next;
fn = vtp->vt_func;
vtp->vt_func = (vtfunc_t)NULL;
/* The callback is invoked outside the kernel critical zone.*/
chSysUnlockFromISR();
fn(vtp->vt_par);
chSysLockFromISR();