mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt : change task to decease dram(heap)
1. decrease the task size(HCI cannot < 1024, btu cannot < 4096) 2. btc task can config by menuconfig(default 2048)
This commit is contained in:
parent
c9a0b9a45c
commit
1173106a20
@ -8,11 +8,11 @@ config BT_ENABLED
|
||||
help
|
||||
This compiles in the low-level BT stack.
|
||||
|
||||
menu "BT_UTIL"
|
||||
menu "BT UTILITY OPTION"
|
||||
visible if BT_ENABLED
|
||||
|
||||
config BT_USE_ETS_PRINT
|
||||
bool "BT USE ETS_PRINT"
|
||||
bool "BT use print which has lock"
|
||||
default y
|
||||
depends on BT_ENABLED
|
||||
help
|
||||
@ -20,6 +20,13 @@ config BT_USE_ETS_PRINT
|
||||
|
||||
endmenu #menu
|
||||
|
||||
config BTC_TASK_STACK_SIZE
|
||||
int "BT event (callback to application) task stack size"
|
||||
default 2048
|
||||
depends on BT_ENABLED
|
||||
help
|
||||
This select btc task stack size
|
||||
|
||||
#config BT_BTLE
|
||||
# bool "Enable BTLE"
|
||||
# depends on BT_ENABLED
|
||||
|
@ -17,11 +17,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "bt_defs.h"
|
||||
|
||||
#define BTC_TASK_QUEUE_NUM 20
|
||||
#define BTC_TASK_STACK_SIZE 4096
|
||||
#define BTC_TASK_NAME "btcT"
|
||||
#define BTC_TASK_PRIO (configMAX_PRIORITIES - 5)
|
||||
#include "thread.h"
|
||||
|
||||
typedef struct btc_msg {
|
||||
uint8_t sig; //event signal
|
||||
|
@ -101,8 +101,8 @@ 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", 4096 + 2048, NULL, configMAX_PRIORITIES - 3, &xHciH4TaskHandle);
|
||||
xHciH4Queue = xQueueCreate(HCI_H4_QUEUE_NUM, sizeof(BtTaskEvt_t));
|
||||
xTaskCreate(hci_hal_h4_rx_handler, HCI_H4_TASK_NAME, HCI_H4_TASK_STACK_SIZE, NULL, HCI_H4_TASK_PRIO, &xHciH4TaskHandle);
|
||||
|
||||
//register vhci host cb
|
||||
API_vhci_host_register_callback(&vhci_host_cb);
|
||||
|
@ -113,8 +113,8 @@ int hci_start_up(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
xHciHostQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
|
||||
xTaskCreate(hci_host_thread_handler, "HciHostT", (4096 + 2048), NULL, configMAX_PRIORITIES - 3, &xHciHostTaskHandle);
|
||||
xHciHostQueue = xQueueCreate(HCI_HOST_QUEUE_NUM, sizeof(BtTaskEvt_t));
|
||||
xTaskCreate(hci_host_thread_handler, HCI_HOST_TASK_NAME, HCI_HOST_TASK_STACK_SIZE, NULL, HCI_HOST_TASK_PRIO, &xHciHostTaskHandle);
|
||||
|
||||
packet_fragmenter->init(&packet_fragmenter_callbacks);
|
||||
hal->open(&hal_callbacks);
|
||||
|
@ -43,6 +43,26 @@ enum {
|
||||
SIG_BTIF_WORK = 0xff
|
||||
};
|
||||
|
||||
#define HCI_HOST_TASK_STACK_SIZE 1024
|
||||
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 3)
|
||||
#define HCI_HOST_TASK_NAME "hciHostT"
|
||||
#define HCI_HOST_QUEUE_NUM 30
|
||||
|
||||
#define HCI_H4_TASK_STACK_SIZE 1024
|
||||
#define HCI_H4_TASK_PRIO (configMAX_PRIORITIES - 3)
|
||||
#define HCI_H4_TASK_NAME "hciH4T"
|
||||
#define HCI_H4_QUEUE_NUM 30
|
||||
|
||||
#define BTU_TASK_STACK_SIZE 4096
|
||||
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 1)
|
||||
#define BTU_TASK_NAME "btuT"
|
||||
#define BTU_QUEUE_NUM 30
|
||||
|
||||
#define BTC_TASK_QUEUE_NUM 20
|
||||
#define BTC_TASK_STACK_SIZE CONFIG_BTC_TASK_STACK_SIZE //by menuconfig
|
||||
#define BTC_TASK_NAME "btcT"
|
||||
#define BTC_TASK_PRIO (configMAX_PRIORITIES - 5)
|
||||
|
||||
void btu_task_post(uint32_t sig);
|
||||
void hci_host_task_post(void);
|
||||
void hci_hal_h4_task_post(void);
|
||||
|
@ -201,7 +201,7 @@ void BTU_StartUp(void)
|
||||
}
|
||||
|
||||
xBtuQueue = xQueueCreate(60, sizeof(BtTaskEvt_t));
|
||||
xTaskCreate(btu_task_thread_handler, "BtuT", 8192, NULL, configMAX_PRIORITIES - 1, &xBtuTaskHandle);
|
||||
xTaskCreate(btu_task_thread_handler, BTU_TASK_NAME, BTU_TASK_STACK_SIZE, NULL, BTU_TASK_PRIO, &xBtuTaskHandle);
|
||||
btu_task_post(SIG_BTU_START_UP);
|
||||
/*
|
||||
// Continue startup on bt workqueue thread.
|
||||
|
Loading…
x
Reference in New Issue
Block a user