I use app_button with simple handle function. When button is pressed the led is on, when released the led is off. Everything works fine, but after some random number button is pressed, the system go in an endless loop and nothing works anymore. The loop is in the timer_timeouts_check() function:
// Expire all timers within ticks_elapsed and collect ticks_expired.
while (p_timer != NULL)
{
// Do nothing if timer did not expire.
if (ticks_elapsed < p_timer->ticks_to_expire)
{
break;
}
// Decrement ticks_elapsed and collect expired ticks.
ticks_elapsed -= p_timer->ticks_to_expire;
ticks_expired += p_timer->ticks_to_expire;
// Move to next timer.
p_previous_timer = p_timer;
p_timer = p_timer->next;
// Execute Task.
if (p_previous_timer->is_running)
{
p_previous_timer->is_running = false;
timeout_handler_exec(p_previous_timer);
}
}
I don't use Softdevice, I am using SDK12.1.0 and have a custom board. What can I do?