Skip to content

Commit cca4090

Browse files
committed
NRF51, NRF52: Implement us_ticker_free() function.
1 parent 4d56b00 commit cca4090

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/us_ticker.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ void us_ticker_clear_interrupt(void)
137137

138138
void us_ticker_free(void)
139139
{
140-
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
141-
// disabled here, but this does not cause any extra cost.
140+
nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_STOP);
141+
142+
nrf_timer_int_disable(NRF_TIMER1, nrf_timer_compare_int_get(NRF_TIMER_CC_CHANNEL0));
143+
144+
us_ticker_initialized = false;
142145
}

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ void us_ticker_clear_interrupt(void)
137137

138138
void us_ticker_free(void)
139139
{
140-
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
141-
// disabled here, but this does not cause any extra cost.
140+
nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_STOP);
141+
142+
nrf_timer_int_disable(NRF_TIMER1, nrf_timer_compare_int_get(NRF_TIMER_CC_CHANNEL0));
143+
144+
us_ticker_initialized = false;
142145
}

0 commit comments

Comments
 (0)