fix(wifi): fix external coexistence depends on wifi connect issue

This commit is contained in:
muhaidong
2026-03-10 17:40:51 +08:00
parent d20c50cd63
commit 40f5755a7c
7 changed files with 91 additions and 30 deletions
+4 -11
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -17,9 +17,7 @@
#include "esp_private/gpio.h"
#endif
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
#include "esp_private/esp_modem_clock.h"
#endif
#include "esp_private/periph_ctrl.h"
#if SOC_EXTERNAL_COEX_ADVANCE
#define EXTERNAL_COEX_SIGNAL_I0_IDX EXTERN_ACTIVE_I_IDX
@@ -263,16 +261,11 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex
return ESP_ERR_INVALID_ARG;
#endif /* SOC_EXTERNAL_COEX_ADVANCE */
}
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_enable(PERIPH_COEX_MODULE);
#endif
coex_module_enable();
#if SOC_EXTERNAL_COEX_ADVANCE
esp_coex_external_params(g_external_coex_params, 0, 0);
#endif
esp_err_t ret = esp_coex_external_set(EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_HIGH);
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_disable(PERIPH_COEX_MODULE);
#endif
if (ESP_OK != ret) {
return ESP_FAIL;
}
@@ -282,7 +275,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex
esp_err_t esp_disable_extern_coex_gpio_pin(void)
{
esp_coex_external_stop();
coex_module_disable();
return ESP_OK;
}
#endif /* External Coex */
+6 -16
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -18,9 +18,7 @@
#include "soc/gpio_sig_map.h"
#include "esp_rom_gpio.h"
#include "soc/soc.h"
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
#include "esp_private/esp_modem_clock.h"
#endif
#include "esp_private/periph_ctrl.h"
#if CONFIG_ESP_COEX_GPIO_DEBUG
static char* TAG = "coexist debug";
@@ -191,13 +189,9 @@ esp_err_t esp_coexist_debug_matrix_init(int evt, int sig, bool rev)
esp_err_t esp_coexist_gpio_debug_matrix_config(int event)
{
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_enable(PERIPH_COEX_MODULE);
#endif
coex_module_enable();
esp_err_t ret = coex_gpio_debug_matrix_config(event);
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_disable(PERIPH_COEX_MODULE);
#endif
coex_module_disable();
return ret;
}
@@ -264,14 +258,10 @@ esp_err_t esp_coexist_debug_init(void)
gpio_set_level(s_io_nums[i], false);
}
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_enable(PERIPH_COEX_MODULE);
#endif
coex_module_enable();
/* Init coexist hardware signal */
ESP_ERROR_CHECK(coex_gpio_debug_matrix_init());
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
modem_clock_module_disable(PERIPH_COEX_MODULE);
#endif
coex_module_disable();
return ESP_OK;
}