us_ticker_set_interrupt() should set an interrupt for the given timestamp even if there's a pending interrupt.

pull/932/head
Rohit Grover 2015-02-24 14:18:33 +00:00
parent 8c21ef208c
commit 53d2b152c4
1 changed files with 4 additions and 6 deletions

View File

@ -174,15 +174,13 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
us_ticker_init(); us_ticker_init();
} }
if (us_ticker_callbackPending) {
return;
}
uint32_t callbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp); uint32_t callbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp);
NRF_RTC1->CC[0] = callbackTime & MAX_RTC_COUNTER_VAL; NRF_RTC1->CC[0] = callbackTime & MAX_RTC_COUNTER_VAL;
us_ticker_callbackTimestamp = callbackTime; us_ticker_callbackTimestamp = callbackTime;
us_ticker_callbackPending = true; if (!us_ticker_callbackPending) {
rtc1_enableCompareInterrupt(); us_ticker_callbackPending = true;
rtc1_enableCompareInterrupt();
}
} }
void us_ticker_disable_interrupt(void) void us_ticker_disable_interrupt(void)