From 86b2779adcb2c33c0b848f98b8fdea62032bb97e Mon Sep 17 00:00:00 2001 From: wangmengyang <wangmengyang@espressif.com> Date: Fri, 20 Jan 2023 10:53:52 +0800 Subject: [PATCH] bluetooth: fix that functions "coex_enable" and "coex_disable" are not used in pairs on ESP32-C3 and ESP32-S3 --- components/bt/controller/esp32c3/bt.c | 5 ++++- components/bt/controller/esp32s3/bt.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 98e6feec716b..1371f16b8eb4 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -1425,7 +1425,7 @@ esp_err_t esp_bt_controller_deinit(void) esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) { - int ret = ESP_OK; + esp_err_t ret = ESP_OK; if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_INITED) { return ESP_ERR_INVALID_STATE; @@ -1480,6 +1480,9 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) #endif } while (0); +#if CONFIG_SW_COEXIST_ENABLE + coex_disable(); +#endif return ret; } diff --git a/components/bt/controller/esp32s3/bt.c b/components/bt/controller/esp32s3/bt.c index 89f1e5ded2a1..be69d7dc096e 100644 --- a/components/bt/controller/esp32s3/bt.c +++ b/components/bt/controller/esp32s3/bt.c @@ -1472,7 +1472,7 @@ esp_err_t esp_bt_controller_deinit(void) esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) { - int ret = ESP_OK; + esp_err_t ret = ESP_OK; if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_INITED) { return ESP_ERR_INVALID_STATE; @@ -1527,6 +1527,9 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) #endif } while (0); +#if CONFIG_SW_COEXIST_ENABLE + coex_disable(); +#endif return ret; }