From 788f7265c0e7bb0eed0584f513930a5ae418d3d8 Mon Sep 17 00:00:00 2001 From: zwj Date: Mon, 1 Aug 2022 15:30:14 +0800 Subject: [PATCH] Update BLE lib for ESP32-C3 and ESP32-S3 - update ble tx power level mapping - Fixed ble sch_arb assert --- components/bt/controller/esp32c3/Kconfig.in | 36 +++++++++---------- components/bt/controller/esp32s3/Kconfig.in | 36 +++++++++---------- components/bt/controller/lib_esp32c3_family | 2 +- .../bt/include/esp32c3/include/esp_bt.h | 32 ++++++++--------- .../bt/include/esp32s3/include/esp_bt.h | 34 +++++++++--------- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index 94b31a3d84..9d409ab269 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -138,8 +138,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL help Specify default Tx power level - config BT_CTRL_DFT_TX_POWER_LEVEL_N27 - bool "-27dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N24 bool "-24dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N21 @@ -170,26 +168,28 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL bool "+15dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_P18 bool "+18dBm" + config BT_CTRL_DFT_TX_POWER_LEVEL_P21 + bool "+21dBm" endchoice config BT_CTRL_DFT_TX_POWER_LEVEL_EFF int - default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27 - default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 - default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 - default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 - default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 - default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 - default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 - default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 - default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 - default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 - default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 - default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 - default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 - default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 - default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 - default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 + default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 + default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 + default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 + default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 + default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 + default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 + default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 + default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 + default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 + default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 + default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 + default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 + default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 + default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21 default 0 config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP diff --git a/components/bt/controller/esp32s3/Kconfig.in b/components/bt/controller/esp32s3/Kconfig.in index db6cb10e57..66ae91a5a3 100644 --- a/components/bt/controller/esp32s3/Kconfig.in +++ b/components/bt/controller/esp32s3/Kconfig.in @@ -153,8 +153,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL help Specify default Tx power level - config BT_CTRL_DFT_TX_POWER_LEVEL_N27 - bool "-27dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N24 bool "-24dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N21 @@ -185,27 +183,29 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL bool "+15dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_P18 bool "+18dBm" + config BT_CTRL_DFT_TX_POWER_LEVEL_P18 + bool "+21dBm" endchoice config BT_CTRL_DFT_TX_POWER_LEVEL_EFF int - default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27 - default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 - default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 - default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 - default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 - default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 - default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 - default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 - default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 - default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 - default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 - default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 - default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 - default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 - default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 - default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 + default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 + default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 + default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 + default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 + default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 + default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 + default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 + default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 + default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 + default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 + default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 + default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 + default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 + default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21 default 0 diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index d1c2082e56..3b0038690a 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit d1c2082e5633a89c6fd6051c7761c1e697cb7a2e +Subproject commit 3b0038690a644498d6d80f1de8df0efff8cd8cf5 diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 2ec3064d6e..ed979ff58c 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -290,22 +290,22 @@ typedef enum { * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). */ typedef enum { - ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */ - ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */ - ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */ - ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */ - ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */ - ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */ - ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */ - ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */ + ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */ + ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */ + ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */ + ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */ + ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */ + ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */ + ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */ + ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */ + ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */ + ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */ + ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */ + ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */ + ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */ + ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */ ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ } esp_power_level_t; diff --git a/components/bt/include/esp32s3/include/esp_bt.h b/components/bt/include/esp32s3/include/esp_bt.h index 7bc1f0b6e2..ad97b75ecc 100644 --- a/components/bt/include/esp32s3/include/esp_bt.h +++ b/components/bt/include/esp32s3/include/esp_bt.h @@ -289,23 +289,23 @@ typedef enum { * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). */ typedef enum { - ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */ - ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */ - ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */ - ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */ - ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */ - ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */ - ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */ - ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */ - ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ + ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */ + ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */ + ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */ + ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */ + ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */ + ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */ + ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */ + ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */ + ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */ + ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */ + ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */ + ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */ + ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */ + ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */ + ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */ + ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ } esp_power_level_t; /**