Fixed error in chVTDoResetI()

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7850 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-04-04 08:01:46 +00:00
parent 15d0007e96
commit b3c635dc4b
2 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,6 @@ static inline void st_lld_stop_alarm(void) {
static inline void st_lld_set_alarm(systime_t time) { static inline void st_lld_set_alarm(systime_t time) {
STM32_ST_TIM->CCR[0] = (uint32_t)time; STM32_ST_TIM->CCR[0] = (uint32_t)time;
STM32_ST_TIM->SR = 0;
} }
/** /**

View File

@ -217,6 +217,7 @@ void chVTDoResetI(virtual_timer_t *vtp) {
/* Removing the first timer from the list.*/ /* Removing the first timer from the list.*/
ch.vtlist.vt_next = vtp->vt_next; ch.vtlist.vt_next = vtp->vt_next;
ch.vtlist.vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist; ch.vtlist.vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist;
vtp->vt_func = NULL;
/* If the list become empty then the alarm timer is stopped and done.*/ /* If the list become empty then the alarm timer is stopped and done.*/
if (&ch.vtlist == (virtual_timers_list_t *)ch.vtlist.vt_next) { if (&ch.vtlist == (virtual_timers_list_t *)ch.vtlist.vt_next) {
@ -230,9 +231,9 @@ void chVTDoResetI(virtual_timer_t *vtp) {
/* If the new first timer has a delta of zero then the alarm is not /* If the new first timer has a delta of zero then the alarm is not
modified, the already programmed alarm will serve it.*/ modified, the already programmed alarm will serve it.*/
if (ch.vtlist.vt_next->vt_delta == 0) { /* if (ch.vtlist.vt_next->vt_delta == 0) {
return; return;
} }*/
/* Distance in ticks between the last alarm event and current time.*/ /* Distance in ticks between the last alarm event and current time.*/
nowdelta = chVTGetSystemTimeX() - ch.vtlist.vt_lasttime; nowdelta = chVTGetSystemTimeX() - ch.vtlist.vt_lasttime;