mirror of https://github.com/ARMmbed/mbed-os.git
set_interrupt: short-circuit the setting of the same interrupt.
parent
54dc3c1dcf
commit
7d688ad607
|
@ -174,7 +174,10 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
|
|||
us_ticker_init();
|
||||
}
|
||||
|
||||
uint32_t callbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp);
|
||||
uint32_t callbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp);
|
||||
if (us_ticker_callbackPending && (callbackTime == us_ticker_callbackTimestamp)) {
|
||||
return;
|
||||
}
|
||||
NRF_RTC1->CC[0] = callbackTime & MAX_RTC_COUNTER_VAL;
|
||||
us_ticker_callbackTimestamp = callbackTime;
|
||||
if (!us_ticker_callbackPending) {
|
||||
|
|
Loading…
Reference in New Issue