mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
don't add timer twice
This commit is contained in:
parent
101aeb7e9c
commit
e84cf9a425
@ -101,6 +101,11 @@ static void embedded_add_timer(timer_source_t *ts){
|
||||
#ifdef HAVE_TICK
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) &timers; it->next ; it = it->next){
|
||||
// don't add timer that's already in there
|
||||
if ((timer_source_t *) it->next == ts){
|
||||
log_error( "run_loop_timer_add error: timer to add already in list!\n");
|
||||
return;
|
||||
}
|
||||
if (ts->timeout < ((timer_source_t *) it->next)->timeout) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user