git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6022 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
6a24f95f53
commit
dbdf30d290
|
@ -40,7 +40,7 @@
|
|||
/**
|
||||
* @brief Kernel version string.
|
||||
*/
|
||||
#define CH_KERNEL_VERSION "2.7.0unstable"
|
||||
#define CH_KERNEL_VERSION "3.0.0dev"
|
||||
|
||||
/**
|
||||
* @name Kernel version
|
||||
|
@ -49,12 +49,12 @@
|
|||
/**
|
||||
* @brief Kernel version major number.
|
||||
*/
|
||||
#define CH_KERNEL_MAJOR 2
|
||||
#define CH_KERNEL_MAJOR 3
|
||||
|
||||
/**
|
||||
* @brief Kernel version minor number.
|
||||
*/
|
||||
#define CH_KERNEL_MINOR 7
|
||||
#define CH_KERNEL_MINOR 0
|
||||
|
||||
/**
|
||||
* @brief Kernel version patch number.
|
||||
|
|
|
@ -382,11 +382,11 @@ static inline void chVTDoTickI(void) {
|
|||
}
|
||||
}
|
||||
#else /* CH_CFG_TIMEDELTA > 0 */
|
||||
if (&vtlist != (virtual_timers_list_t *)vtlist.vt_next) {
|
||||
virtual_timer_t *vtp;
|
||||
systime_t now = chVTGetSystemTimeI();
|
||||
systime_t delta = now - vtlist.vt_lasttime;
|
||||
|
||||
--vtlist.vt_next->vt_delta;
|
||||
while (!(vtp = vtlist.vt_next)->vt_delta) {
|
||||
while ((vtp = vtlist.vt_next)->vt_delta <= delta) {
|
||||
vtfunc_t fn = vtp->vt_func;
|
||||
vtp->vt_func = (vtfunc_t)NULL;
|
||||
vtp->vt_next->vt_prev = (void *)&vtlist;
|
||||
|
@ -395,6 +395,17 @@ static inline void chVTDoTickI(void) {
|
|||
fn(vtp->vt_par);
|
||||
chSysLockFromIsr();
|
||||
}
|
||||
if (&vtlist == (virtual_timers_list_t *)vtlist.vt_next) {
|
||||
/* The list is empty, no tick event needed so the alarm timer
|
||||
is stopped.*/
|
||||
port_timer_stop_alarm();
|
||||
}
|
||||
else {
|
||||
/* The delta is subtracted to the next list element, the current time
|
||||
becomes the new delta list base time.*/
|
||||
vtp->vt_delta -= delta;
|
||||
vtlist.vt_lasttime = now;
|
||||
port_timer_set_alarm(now + vtp->vt_delta);
|
||||
}
|
||||
#endif /* CH_CFG_TIMEDELTA > 0 */
|
||||
}
|
||||
|
|
|
@ -139,15 +139,23 @@ void chVTDoSetI(virtual_timer_t *vtp, systime_t delay,
|
|||
if (delay < CH_CFG_TIMEDELTA)
|
||||
delay = CH_CFG_TIMEDELTA;
|
||||
|
||||
if (&vtlist == (virtual_timers_list_t *)p) {
|
||||
/* The delta list is empty, the current time becomes the new
|
||||
delta list base time.*/
|
||||
vtlist.vt_lasttime = now;
|
||||
port_timer_start_alarm(vtlist.vt_lasttime + delay);
|
||||
}
|
||||
else {
|
||||
/* Now the delay is calculated as delta from the last tick interrupt
|
||||
time.*/
|
||||
delay += now - vtlist.vt_lasttime;
|
||||
|
||||
if (&vtlist != (virtual_timers_list_t *)p)
|
||||
port_timer_start_alarm(vtlist.vt_lasttime + delay);
|
||||
else if (delay < p->vt_delta)
|
||||
/* If the specified delay is closer in time than the first element
|
||||
in the delta list then it becomes the next alarm event in time.*/
|
||||
if (delay < p->vt_delta)
|
||||
port_timer_set_alarm(vtlist.vt_lasttime + delay);
|
||||
}
|
||||
}
|
||||
#endif /* CH_CFG_TIMEDELTA > 0 */
|
||||
|
||||
/* The delta list is scanned in order to find the correct position for
|
||||
|
|
Loading…
Reference in New Issue