diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c index 5ec599c14f..aa6c6ad47b 100644 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c @@ -174,15 +174,13 @@ void us_ticker_set_interrupt(timestamp_t timestamp) us_ticker_init(); } - if (us_ticker_callbackPending) { - return; - } - uint32_t callbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp); NRF_RTC1->CC[0] = callbackTime & MAX_RTC_COUNTER_VAL; us_ticker_callbackTimestamp = callbackTime; - us_ticker_callbackPending = true; - rtc1_enableCompareInterrupt(); + if (!us_ticker_callbackPending) { + us_ticker_callbackPending = true; + rtc1_enableCompareInterrupt(); + } } void us_ticker_disable_interrupt(void)