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

Using timer with sd_app_evt_wait()

I am trying to run my program once per second using timer. The timer is initialized as follows:

APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);

err_code = app_timer_create(&m_timer_id, APP_TIMER_MODE_REPEATED, timeout_handler);

err_code = app_timer_start(m_timer_id, TIMER_INTERVAL, NULL);

The main loop is then simply:

while (1) { sd_app_evt_wait(); do_my_things(); }

However, now that timer triggers first time, the loop starts to run at full speed. Should I somehow acknowledge the timer event in order to be able to wait again?

Related