From 331cf8816e6994ada53e43759507f6dc53db6c74 Mon Sep 17 00:00:00 2001 From: baohongde Date: Thu, 16 Jan 2020 17:22:00 +0800 Subject: [PATCH] components/bt: backport release/v3.1 Fix A2DP stuck when BLE's interval is too small Fix assert due to no free element from --- components/bt/Kconfig | 13 +++++++++++++ components/bt/include/esp_bt.h | 8 ++++++++ components/bt/lib | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/components/bt/Kconfig b/components/bt/Kconfig index 2167d5563..fa810cdb7 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -29,6 +29,19 @@ config BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF default 1 if BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM default 0 +config BTDM_CONTROLLER_AUTO_LATENCY + bool "Auto latency" + depends on BT_ENABLED + default n + help + BLE auto latency, used to enhance classic BT performance + while classic BT and BLE are enabled at the same time. + +config BTDM_CONTROLLER_AUTO_LATENCY_EFF + bool + default BTDM_CONTROLLER_AUTO_LATENCY if BT_ENABLED + default n + choice BTDM_CONTROLLER_PINNED_TO_CORE_CHOICE prompt "The cpu core which bluetooth controller run" depends on BT_ENABLED && !FREERTOS_UNICORE diff --git a/components/bt/include/esp_bt.h b/components/bt/include/esp_bt.h index dcb5d9015..f8e6d67fd 100644 --- a/components/bt/include/esp_bt.h +++ b/components/bt/include/esp_bt.h @@ -41,6 +41,7 @@ typedef struct { uint16_t send_adv_reserved_size; /*!< Controller minimum memory value */ uint32_t controller_debug_flag; /*!< Controller debug log flag */ uint8_t bt_sco_datapath; /*!< SCO data path, i.e. HCI or PCM module */ + bool auto_latency; /*!< BLE auto latency, used to enhance classic BT performance */ } esp_bt_controller_config_t; #ifdef CONFIG_BT_ENABLED @@ -88,6 +89,12 @@ the adv packet will be discarded until the memory is restored. */ #define MESH_DUPLICATE_SCAN_CACHE_SIZE 0 #endif +#ifdef CONFIG_BTDM_CONTROLLER_AUTO_LATENCY_EFF +#define BTDM_CONTROLLER_AUTO_LATENCY_EFF CONFIG_BTDM_CONTROLLER_AUTO_LATENCY_EFF +#else +#define BTDM_CONTROLLER_AUTO_LATENCY_EFF false +#endif + #define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \ .controller_task_stack_size = ESP_TASK_BT_CONTROLLER_STACK, \ .controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \ @@ -99,6 +106,7 @@ the adv packet will be discarded until the memory is restored. */ .send_adv_reserved_size = SCAN_SEND_ADV_RESERVED_SIZE, \ .controller_debug_flag = CONTROLLER_ADV_LOST_DEBUG_BIT, \ .bt_sco_datapath = CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF, \ + .auto_latency = BTDM_CONTROLLER_AUTO_LATENCY_EFF, \ }; #else diff --git a/components/bt/lib b/components/bt/lib index 2c9e7ecf9..3e6557c91 160000 --- a/components/bt/lib +++ b/components/bt/lib @@ -1 +1 @@ -Subproject commit 2c9e7ecf90c7915244029848b12b198bee110544 +Subproject commit 3e6557c91f8abd0ccfd986d576ddd896a20b3fa4