diff options
Diffstat (limited to 'hci')
-rw-r--r-- | hci/src/hci_layer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hci/src/hci_layer.c b/hci/src/hci_layer.c index fb2bb972e..fa65e6e02 100644 --- a/hci/src/hci_layer.c +++ b/hci/src/hci_layer.c @@ -464,14 +464,14 @@ static void event_command_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) // Move it to the list of commands awaiting response pthread_mutex_lock(&commands_pending_response_lock); list_append(commands_pending_response, wait_entry); + + non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); pthread_mutex_unlock(&commands_pending_response_lock); // Send it off low_power_manager->wake_assert(); packet_fragmenter->fragment_and_dispatch(wait_entry->command); low_power_manager->transmit_done(); - - non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); } } @@ -709,7 +709,9 @@ static bool filter_incoming_event(BT_HDR *packet) { return false; intercepted:; + pthread_mutex_lock(&commands_pending_response_lock); non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); + pthread_mutex_unlock(&commands_pending_response_lock); if (wait_entry) { // If it has a callback, it's responsible for freeing the packet |