call only one timer's callback which has the high priority inside of opentimers2 callback.
@@ -339,7 +339,6 @@ void opentimers2_timer_callback(void){
opentimers2_vars.lastTimeout = tempLastTimeout;
// 2. call the callback of expired timers
- for (i=0;i<MAX_NUM_TIMERS;i++){
idToCallCB = TOO_MANY_TIMERS_ERROR;
// find out the timer expired with highest priority
for (j=0;j<MAX_NUM_TIMERS;j++){
@@ -355,7 +354,6 @@ void opentimers2_timer_callback(void){
}
if (idToCallCB==TOO_MANY_TIMERS_ERROR){
// no more timer expired
- break;
} else {
// call all timers expired having the same priority with timer idToCallCB
for (j=0;j<MAX_NUM_TIMERS;j++){
@@ -370,7 +368,6 @@ void opentimers2_timer_callback(void){
}
}
}
- }
// 3. find the next timer to be fired
timerGap = opentimers2_vars.timersBuf[0].currentCompareValue-opentimers2_vars.lastTimeout;
