add protection for scheduleIn function.
@@ -92,6 +92,8 @@ void opentimers_scheduleIn(opentimers_id_t id,
return;
}
+ DISABLE_INTERRUPTS();
+
opentimers_vars.timersBuf[id].timerType = timer_type;
// 2. updat the timer content
@@ -159,6 +161,7 @@ void opentimers_scheduleIn(opentimers_id_t id,
sctimer_setCompare(opentimers_vars.currentTimeout);
}
opentimers_vars.running = TRUE;
+ ENABLE_INTERRUPTS();
}
/**
