Merge pull request #1281 from jpbrucker/fix_us_ticker

Nordic: handle unwanted RTC interrupts
pull/1144/merge
Martin Kojtal 2015-08-13 10:21:57 +01:00
commit cc42528dbc
1 changed files with 3 additions and 2 deletions

View File

@ -159,10 +159,11 @@ void RTC1_IRQHandler(void)
NRF_RTC1->EVENTS_OVRFLW = 0;
NRF_RTC1->EVTENCLR = RTC_EVTEN_OVRFLW_Msk;
}
if (NRF_RTC1->EVENTS_COMPARE[0] && us_ticker_callbackPending && ((int)(us_ticker_callbackTimestamp - rtc1_getCounter()) <= 0)) {
if (NRF_RTC1->EVENTS_COMPARE[0]) {
NRF_RTC1->EVENTS_COMPARE[0] = 0;
NRF_RTC1->EVTENCLR = RTC_EVTEN_COMPARE0_Msk;
invokeCallback();
if (us_ticker_callbackPending && ((int)(us_ticker_callbackTimestamp - rtc1_getCounter()) <= 0))
invokeCallback();
}
}