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

restart timer before it expires

hi, i want to restart my timer before it expires. suppose my timeout is 2 second and i want to restart it in between 0-2 second based on signal when i receive before expires.

thanks!!

  • I didn't tried but its a very simple question. You can directly call the app_timer_start() again. If that doesn't work, you can stop the timer using app_timer_stop() and again call app_timer_start() at the signal event

  • The correct method is to call app_timer_stop() first, and then call app_timer_start(). The comments for app_timer_start() say the following:

     * @note When calling this method on a timer that is already running, the second start operation
     *       is ignored.
    

    So if you want to restart, you'll have to stop it first.