component/bt: reduce bt tasks' stack size

This commit is contained in:
wangmengyang 2016-11-26 16:46:52 +08:00
parent 2e8af3a8b7
commit 2c577b1360
5 changed files with 6 additions and 11 deletions

View 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); hci_hal_env_init(HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX);
xHciH4Queue = xQueueCreate(60, sizeof(BtTaskEvt_t)); 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 //register vhci host cb
API_vhci_host_register_callback(&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) static void hci_hal_h4_rx_handler(void *arg)
{ {
BtTaskEvt_t e; BtTaskEvt_t e;
for (;;) { for (;;) {
if (pdTRUE == xQueueReceive(xHciH4Queue, &e, (portTickType)portMAX_DELAY)) { if (pdTRUE == xQueueReceive(xHciH4Queue, &e, (portTickType)portMAX_DELAY)) {
if (e.sig == 0xff) { if (e.sig == 0xff) {

View file

@ -114,7 +114,7 @@ int hci_start_up(void)
} }
xHciHostQueue = xQueueCreate(60, sizeof(BtTaskEvt_t)); 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); packet_fragmenter->init(&packet_fragmenter_callbacks);
hal->open(&hal_callbacks); hal->open(&hal_callbacks);
@ -228,7 +228,6 @@ static void hci_host_thread_handler(void *arg)
*/ */
BtTaskEvt_t e; BtTaskEvt_t e;
for (;;) { for (;;) {
if (pdTRUE == xQueueReceive(xHciHostQueue, &e, (portTickType)portMAX_DELAY)) { if (pdTRUE == xQueueReceive(xHciHostQueue, &e, (portTickType)portMAX_DELAY)) {
if (e.sig == 0xff) { if (e.sig == 0xff) {

View file

@ -201,7 +201,8 @@ void BTU_StartUp(void)
} }
xBtuQueue = xQueueCreate(60, sizeof(BtTaskEvt_t)); 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); btu_task_post(SIG_BTU_START_UP);
/* /*
// Continue startup on bt workqueue thread. // Continue startup on bt workqueue thread.

View file

@ -286,10 +286,8 @@ static void btif_thread_post(uint32_t sig)
void btif_task_thread_handler(void *arg) void btif_task_thread_handler(void *arg)
{ {
BtTaskEvt_t *e; BtTaskEvt_t *e;
for (;;) { for (;;) {
if (pdTRUE == xQueueReceive(xBtifQueue, &e, (portTickType)portMAX_DELAY)) { if (pdTRUE == xQueueReceive(xBtifQueue, &e, (portTickType)portMAX_DELAY)) {
if (e->sig == SIG_BTIF_WORK) { if (e->sig == SIG_BTIF_WORK) {
fixed_queue_process(btif_msg_queue); fixed_queue_process(btif_msg_queue);
} }
@ -316,7 +314,7 @@ bt_status_t btif_init_bluetooth(void)
goto error_exit; goto error_exit;
} }
xBtifQueue = xQueueCreate(60, sizeof(void *)); 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); fixed_queue_register_dequeue(btif_msg_queue, bt_jni_msg_ready);
return BT_STATUS_SUCCESS; return BT_STATUS_SUCCESS;

View file

@ -752,7 +752,6 @@ static void btif_media_task_post(uint32_t sig)
static void btif_media_task_handler(void *arg) static void btif_media_task_handler(void *arg)
{ {
BtTaskEvt_t *e; BtTaskEvt_t *e;
for (;;) { for (;;) {
if (pdTRUE == xQueueReceive(xBtifMediaQueue, &e, (portTickType)portMAX_DELAY)) { if (pdTRUE == xQueueReceive(xBtifMediaQueue, &e, (portTickType)portMAX_DELAY)) {
// LOG_ERROR("med evt %d\n", e->sig); // LOG_ERROR("med evt %d\n", e->sig);
@ -800,7 +799,7 @@ bool btif_a2dp_start_media_task(void)
if (xBtifMediaQueue == 0) { if (xBtifMediaQueue == 0) {
goto error_exit; 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) { if (xBtifMediaTaskHandle == NULL) {
goto error_exit; 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; num_frames_to_process = btif_media_cb.frames_to_process;
APPL_TRACE_DEBUG(" Process Frames + "); APPL_TRACE_DEBUG(" Process Frames + ");
do { do {
p_msg = (tBT_SBC_HDR *)GKI_getfirst(&(btif_media_cb.RxSbcQ)); p_msg = (tBT_SBC_HDR *)GKI_getfirst(&(btif_media_cb.RxSbcQ));
if (p_msg == NULL) { if (p_msg == NULL) {