]> granicus.if.org Git - esp-idf/commitdiff
component/bt: reduce bt tasks' stack size
authorwangmengyang <wangmengyang@espressif.com>
Sat, 26 Nov 2016 08:46:52 +0000 (16:46 +0800)
committerwangmengyang <wangmengyang@espressif.com>
Sat, 26 Nov 2016 08:46:52 +0000 (16:46 +0800)
components/bt/bluedroid/hci/hci_hal_h4.c
components/bt/bluedroid/hci/hci_layer.c
components/bt/bluedroid/stack/btu/btu_init.c
examples/09_a2dp/components/bluedroid_demos/btif/btif_core.c
examples/09_a2dp/components/bluedroid_demos/btif/btif_media_task.c

index 0fe9aba6968b995f06a4322d51f83f18bb11014b..b3b2856fbaff793b22e8680519e81ed44ab8398c 100644 (file)
@@ -102,7 +102,7 @@ static bool hal_open(const hci_hal_callbacks_t *upper_callbacks)
     hci_hal_env_init(HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX);
 
     xHciH4Queue = xQueueCreate(60, sizeof(BtTaskEvt_t));
-    xTaskCreate(hci_hal_h4_rx_handler, "HciH4T", 2048 + 1024, NULL, configMAX_PRIORITIES - 3, &xHciH4TaskHandle);
+    xTaskCreate(hci_hal_h4_rx_handler, "HciH4T", 1024 + 256, NULL, configMAX_PRIORITIES - 3, &xHciH4TaskHandle);
 
     //register vhci host cb
     API_vhci_host_register_callback(&vhci_host_cb);
@@ -159,7 +159,6 @@ static uint16_t transmit_data(serial_data_type_t type,
 static void hci_hal_h4_rx_handler(void *arg)
 {
     BtTaskEvt_t e;
-
     for (;;) {
         if (pdTRUE == xQueueReceive(xHciH4Queue, &e, (portTickType)portMAX_DELAY)) {
             if (e.sig == 0xff) {
index c468039a9d46b5d59d68b4f3158df5c6537ff9f6..29704d5be31419f553b48a8d412c297b4ed3552a 100644 (file)
@@ -114,7 +114,7 @@ int hci_start_up(void)
     }
 
     xHciHostQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
-    xTaskCreate(hci_host_thread_handler, "HciHostT", (2048 + 1024), NULL, configMAX_PRIORITIES - 3, &xHciHostTaskHandle);
+    xTaskCreate(hci_host_thread_handler, "HciHostT", (1024+256), NULL, configMAX_PRIORITIES - 3, &xHciHostTaskHandle);
 
     packet_fragmenter->init(&packet_fragmenter_callbacks);
     hal->open(&hal_callbacks);
@@ -228,7 +228,6 @@ static void hci_host_thread_handler(void *arg)
      */
 
     BtTaskEvt_t e;
-
     for (;;) {
         if (pdTRUE == xQueueReceive(xHciHostQueue, &e, (portTickType)portMAX_DELAY)) {
             if (e.sig == 0xff) {
index 122c2374c5859d03feb05639d5e497d20986a2fa..68c4e03b5c09ca965c1ba8abb3da9159089fb61c 100644 (file)
@@ -201,7 +201,8 @@ void BTU_StartUp(void)
     }
 
     xBtuQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
-    xTaskCreate(btu_task_thread_handler, "BtuT", 4096, NULL, configMAX_PRIORITIES - 1, &xBtuTaskHandle);
+    xTaskCreate(btu_task_thread_handler, "BtuT", 2048 + 1024, NULL, configMAX_PRIORITIES - 1, &xBtuTaskHandle);
+
     btu_task_post(SIG_BTU_START_UP);
     /*
         // Continue startup on bt workqueue thread.
index 326dead11a4a3589c8bac3629c17c825a85ce1d5..b2ff5ccd6cac16520cf45d9752f94f376dd12403 100644 (file)
@@ -286,10 +286,8 @@ static void btif_thread_post(uint32_t sig)
 void btif_task_thread_handler(void *arg)
 {
     BtTaskEvt_t *e;
-
     for (;;) {
         if (pdTRUE == xQueueReceive(xBtifQueue, &e, (portTickType)portMAX_DELAY)) {
-
             if (e->sig == SIG_BTIF_WORK) {
                 fixed_queue_process(btif_msg_queue);
             }
@@ -316,7 +314,7 @@ bt_status_t btif_init_bluetooth(void)
         goto error_exit;
     }
     xBtifQueue = xQueueCreate(60, sizeof(void *));
-    xTaskCreate(btif_task_thread_handler, "BtifT", 4096, NULL, configMAX_PRIORITIES - 1, &xBtifTaskHandle);
+    xTaskCreate(btif_task_thread_handler, "BtifT", 2048, NULL, configMAX_PRIORITIES - 1, &xBtifTaskHandle);
     fixed_queue_register_dequeue(btif_msg_queue, bt_jni_msg_ready);
 
     return BT_STATUS_SUCCESS;
index 0858d108ccf47da7bdb4de4285ef5b2e30b53ad3..5a18d3af6050ef8af1dce893f732f4c79edf4947 100644 (file)
@@ -752,7 +752,6 @@ static void btif_media_task_post(uint32_t sig)
 static void btif_media_task_handler(void *arg)
 {
     BtTaskEvt_t *e;
-
     for (;;) {
         if (pdTRUE == xQueueReceive(xBtifMediaQueue, &e, (portTickType)portMAX_DELAY)) {
             // LOG_ERROR("med evt %d\n", e->sig);
@@ -800,7 +799,7 @@ bool btif_a2dp_start_media_task(void)
     if (xBtifMediaQueue == 0) {
         goto error_exit;
     }
-    xTaskCreate(btif_media_task_handler, "BtifMediaT\n", 2048 + 1024, NULL, configMAX_PRIORITIES - 1, &xBtifMediaTaskHandle);
+    xTaskCreate(btif_media_task_handler, "BtifMediaT\n", 2048, NULL, configMAX_PRIORITIES - 1, &xBtifMediaTaskHandle);
     if (xBtifMediaTaskHandle == NULL) {
         goto error_exit;
     }
@@ -1193,7 +1192,6 @@ static void btif_media_task_avk_handle_timer(UNUSED_ATTR void *context)
 
         num_frames_to_process = btif_media_cb.frames_to_process;
         APPL_TRACE_DEBUG(" Process Frames + ");
-
         do {
             p_msg = (tBT_SBC_HDR *)GKI_getfirst(&(btif_media_cb.RxSbcQ));
             if (p_msg == NULL) {