sdk 12.3.0
nrf52832
problem:
when I multiple call app_timer_stop.it will return NRF_ERROR_NO_MEM.how to result it?
thx everybod!
sdk 12.3.0
nrf52832
problem:
when I multiple call app_timer_stop.it will return NRF_ERROR_NO_MEM.how to result it?
thx everybod!
haakonsh Makes no sense. But this may happen due to async (event driven) programming. The question was, what happens if someone tries to stop a stopped timer.
Oh in that case nothing should happen as another 'rtc1_stop' will be scheduled, and this function can safely be called multiple times.
See line 176 of app_timer.c:
/**@brief Function for stopping the RTC1 timer.
*/
static void rtc1_stop(void)
{
NVIC_DisableIRQ(RTC1_IRQn);
NRF_RTC1->EVTENCLR = RTC_EVTEN_COMPARE0_Msk;
NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk;
NRF_RTC1->TASKS_STOP = 1;
nrf_delay_us(MAX_RTC_TASKS_DELAY);
NRF_RTC1->TASKS_CLEAR = 1;
m_ticks_latest = 0;
nrf_delay_us(MAX_RTC_TASKS_DELAY);
m_rtc1_running = false;
}