forked from espressif/esp-idf
component/bt : fix enable bug
1. enable will cause exception with list->head memory modify 2. gatt complete, timeout with HCI cmd timeout will cause exception
This commit is contained in:
@@ -405,8 +405,8 @@ static void restart_comamnd_waiting_response_timer(
|
|||||||
timeout = osi_alarm_time_diff(COMMAND_PENDING_TIMEOUT, timeout);
|
timeout = osi_alarm_time_diff(COMMAND_PENDING_TIMEOUT, timeout);
|
||||||
timeout = (timeout <= COMMAND_PENDING_TIMEOUT) ? timeout : COMMAND_PENDING_TIMEOUT;
|
timeout = (timeout <= COMMAND_PENDING_TIMEOUT) ? timeout : COMMAND_PENDING_TIMEOUT;
|
||||||
|
|
||||||
osi_alarm_set(cmd_wait_q->command_response_timer, timeout);
|
|
||||||
cmd_wait_q->timer_is_set = true;
|
cmd_wait_q->timer_is_set = true;
|
||||||
|
osi_alarm_set(cmd_wait_q->command_response_timer, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void command_timed_out(void *context)
|
static void command_timed_out(void *context)
|
||||||
@@ -488,6 +488,8 @@ static bool filter_incoming_event(BT_HDR *packet)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
intercepted:
|
intercepted:
|
||||||
|
restart_comamnd_waiting_response_timer(&hci_host_env.cmd_waiting_q, false);
|
||||||
|
|
||||||
/*Tell HCI Host Task to continue TX Pending commands*/
|
/*Tell HCI Host Task to continue TX Pending commands*/
|
||||||
if (hci_host_env.command_credits &&
|
if (hci_host_env.command_credits &&
|
||||||
!fixed_queue_is_empty(hci_host_env.command_queue)) {
|
!fixed_queue_is_empty(hci_host_env.command_queue)) {
|
||||||
@@ -495,8 +497,6 @@ intercepted:
|
|||||||
}
|
}
|
||||||
//ke_event_set(KE_EVENT_HCI_HOST_THREAD);
|
//ke_event_set(KE_EVENT_HCI_HOST_THREAD);
|
||||||
|
|
||||||
restart_comamnd_waiting_response_timer(&hci_host_env.cmd_waiting_q, false);
|
|
||||||
|
|
||||||
if (wait_entry) {
|
if (wait_entry) {
|
||||||
// If it has a callback, it's responsible for freeing the packet
|
// If it has a callback, it's responsible for freeing the packet
|
||||||
if (event_code == HCI_COMMAND_STATUS_EVT ||
|
if (event_code == HCI_COMMAND_STATUS_EVT ||
|
||||||
|
@@ -44,7 +44,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define HCI_HOST_TASK_STACK_SIZE 1500
|
#define HCI_HOST_TASK_STACK_SIZE 1500
|
||||||
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 3)
|
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 2)
|
||||||
#define HCI_HOST_TASK_NAME "hciHostT"
|
#define HCI_HOST_TASK_NAME "hciHostT"
|
||||||
#define HCI_HOST_QUEUE_NUM 40
|
#define HCI_HOST_QUEUE_NUM 40
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ enum {
|
|||||||
#define HCI_H4_QUEUE_NUM 60
|
#define HCI_H4_QUEUE_NUM 60
|
||||||
|
|
||||||
#define BTU_TASK_STACK_SIZE 4096
|
#define BTU_TASK_STACK_SIZE 4096
|
||||||
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 1)
|
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 4)
|
||||||
#define BTU_TASK_NAME "btuT"
|
#define BTU_TASK_NAME "btuT"
|
||||||
#define BTU_QUEUE_NUM 50
|
#define BTU_QUEUE_NUM 50
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user