diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/us_ticker.c index 0ab3738bb1..fe1f55a686 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/us_ticker.c @@ -137,6 +137,9 @@ void us_ticker_clear_interrupt(void) void us_ticker_free(void) { - // A common counter is used for RTC, lp_ticker and us_ticker, so it can't be - // disabled here, but this does not cause any extra cost. + nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_STOP); + + nrf_timer_int_disable(NRF_TIMER1, nrf_timer_compare_int_get(NRF_TIMER_CC_CHANNEL0)); + + us_ticker_initialized = false; } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c index bacacf9135..3de870a2c6 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c @@ -137,6 +137,9 @@ void us_ticker_clear_interrupt(void) void us_ticker_free(void) { - // A common counter is used for RTC, lp_ticker and us_ticker, so it can't be - // disabled here, but this does not cause any extra cost. + nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_STOP); + + nrf_timer_int_disable(NRF_TIMER1, nrf_timer_compare_int_get(NRF_TIMER_CC_CHANNEL0)); + + us_ticker_initialized = false; }