diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-11-30 10:09:38 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-11-30 10:09:38 +0000 |
commit | 5b59f89d98bc8d4ae1a7269ab1e09a6d8f649d2f (patch) | |
tree | 1c1039d8e59b601a0a96464e505d2cf71d7670f4 | |
parent | 2a7ff56334ae29c61336d47f450a1ce38f6e30db (diff) | |
download | ChibiOS-5b59f89d98bc8d4ae1a7269ab1e09a6d8f649d2f.tar.gz ChibiOS-5b59f89d98bc8d4ae1a7269ab1e09a6d8f649d2f.tar.bz2 ChibiOS-5b59f89d98bc8d4ae1a7269ab1e09a6d8f649d2f.zip |
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
-rw-r--r-- | os/hal/src/st.c | 2 | ||||
-rw-r--r-- | os/rt/include/chvt.h | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/os/hal/src/st.c b/os/hal/src/st.c index 17abecd71..9f067cfeb 100644 --- a/os/hal/src/st.c +++ b/os/hal/src/st.c @@ -94,8 +94,6 @@ void stStartAlarm(systime_t time) { */
void stStopAlarm(void) {
- osalDbgAssert(stIsAlarmActive() != false, "not active");
-
st_lld_stop_alarm();
}
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h index 754483649..9538474c9 100644 --- a/os/rt/include/chvt.h +++ b/os/rt/include/chvt.h @@ -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();
|