update openmotecc2538 sctimer.
// ========================== define ==========================================
#define TIMERLOOP_THRESHOLD 0xffffff // 511 seconds @ 32768Hz clock
+#define MINIMUM_COMPAREVALE_ADVANCE 10
// ========================== variable ========================================
@@ -51,7 +52,7 @@ void sctimer_setCompare(uint32_t val){
// the timer is already late, schedule the ISR right now manually
IntPendSet(INT_SMTIM);
} else {
- if (val-SleepModeTimerCountGet()<TIMERTHRESHOLD){
+ if (val-SleepModeTimerCountGet()<MINIMUM_COMPAREVALE_ADVANCE){
// there is hardware limitation to schedule the timer within TIMERTHRESHOLD ticks
// schedule ISR right now manually
IntPendSet(INT_SMTIM);
