This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app_timer_stop problem

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!

Parents Reply Children
  • 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;
    }
Related