Commit from zer0 on branch b_zer0 (2008-09-09 00:25 CEST) =================================
The sorting of events in the list was not correct (in case of a high-prio event added after a low-prio event). aversive modules/base/scheduler/scheduler_interrupt.c 1.1.2.5 ===================================================== aversive/modules/base/scheduler/scheduler_interrupt.c (1.1.2.4 -> 1.1.2.5) ===================================================== @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Revision : $Id: scheduler_interrupt.c,v 1.1.2.4 2007-10-28 22:32:27 zer0 Exp $ + * Revision : $Id: scheduler_interrupt.c,v 1.1.2.5 2008-09-08 22:25:11 zer0 Exp $ * */ @@ -109,8 +109,15 @@ this should be quite fast since the list is expected to be small. */ + e = SLIST_FIRST(&event_list); /* easy case : list is empty */ - if (SLIST_FIRST(&event_list) == NULL) { + if (e == NULL) { + SLIST_INSERT_HEAD(&event_list, &g_tab_event[i], next); + continue; + } + + /* insert at head if it's the event with highest prio */ + if (g_tab_event[i].priority >= e->priority) { SLIST_INSERT_HEAD(&event_list, &g_tab_event[i], next); continue; } _______________________________________________ Avr-list mailing list Avr-list@droids-corp.org CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive WIKI : http://wiki.droids-corp.org/index.php/Aversive DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/ BUGZILLA : http://bugzilla.droids-corp.org COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog