aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-13 08:52:00 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-13 08:52:00 +0000
commit72d563b45f02270fc18bfa61c0c0e7f94325e091 (patch)
tree991f703d7fd56d5aa76c3afcffd29562e00262ce /os/rt/include
parent750a8f14b696e51b8522cddcf0265775b610dfa1 (diff)
downloadChibiOS-72d563b45f02270fc18bfa61c0c0e7f94325e091.tar.gz
ChibiOS-72d563b45f02270fc18bfa61c0c0e7f94325e091.tar.bz2
ChibiOS-72d563b45f02270fc18bfa61c0c0e7f94325e091.zip
Experimental code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/rt5_dev_point1@10816 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chvt.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index 3dc67f2a3..ea4493df3 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -395,19 +395,26 @@ static inline void chVTDoTickI(void) {
systime_t now;
sysinterval_t delta;
- /* First timer to be processed.*/
+ /* Looping through timers.*/
vtp = ch.vtlist.next;
- now = chVTGetSystemTimeX();
-
- /* All timers within the time window are triggered and removed,
- note that the loop is stopped by the timers header having
- "ch.vtlist.vt_delta == (sysinterval_t)-1" which is greater than
- all deltas.*/
- while (vtp->delta <= chTimeDiffX(ch.vtlist.lasttime, now)) {
+ while (true) {
vtfunc_t fn;
+ /* The loop is stopped by the timers header having
+ "ch.vtlist.vt_delta == (sysinterval_t)-1" which
+ is greater than all deltas.*/
+ now = chVTGetSystemTimeX();
+ if (vtp->delta > chTimeDiffX(ch.vtlist.lasttime, now)) {
+ break;
+ }
+
+#if 0
/* The "last time" becomes this timer's expiration time.*/
ch.vtlist.lasttime = chTimeAddX(ch.vtlist.lasttime, vtp->delta);
+#else
+ /* The "last time" is set to the current time.*/
+ ch.vtlist.lasttime = now;
+#endif
vtp->next->prev = (virtual_timer_t *)&ch.vtlist;
ch.vtlist.next = vtp->next;
@@ -431,10 +438,8 @@ static inline void chVTDoTickI(void) {
of the list.*/
chSysLockFromISR();
- /* Next element in the list, the current time could have advanced so
- recalculating the time window.*/
+ /* Next element in the list.*/
vtp = ch.vtlist.next;
- now = chVTGetSystemTimeX();
}
/* if the list is empty, nothing else to do.*/