mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
coexist: enable coexist when wifi&bt are enabled, disable coexist when one of wifi&bt is disabled.
This commit is contained in:
@@ -211,12 +211,6 @@ void start_cpu0_default(void)
|
||||
esp_core_dump_init();
|
||||
#endif
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
if (coex_init() == ESP_OK) {
|
||||
coexist_set_enable(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
xTaskCreatePinnedToCore(&main_task, "main",
|
||||
ESP_TASK_MAIN_STACK, NULL,
|
||||
ESP_TASK_MAIN_PRIO, NULL, 0);
|
||||
|
@@ -25,6 +25,11 @@ extern "C" {
|
||||
*/
|
||||
esp_err_t coex_init(void);
|
||||
|
||||
/**
|
||||
* @brief De-init software coexist
|
||||
*/
|
||||
void coex_deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Get software coexist enable or not
|
||||
*
|
||||
|
@@ -130,6 +130,7 @@ esp_err_t esp_wifi_init(wifi_init_config_t *config);
|
||||
* Free all resource allocated in esp_wifi_init and stop WiFi task
|
||||
*
|
||||
* @attention 1. This API should be called if you want to remove WiFi driver from the system
|
||||
* @attention 2. This API can not be called yet and will be done in the future.
|
||||
*
|
||||
* @return ESP_OK: succeed
|
||||
*/
|
||||
|
Submodule components/esp32/lib updated: bc16e8c074...ed85cf9156
@@ -35,6 +35,7 @@
|
||||
#include "phy.h"
|
||||
#include "phy_init_data.h"
|
||||
#include "rtc.h"
|
||||
#include "esp_coexist.h"
|
||||
|
||||
static const char* TAG = "phy_init";
|
||||
|
||||
@@ -65,6 +66,10 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data,
|
||||
phy_set_wifi_mode_only(0);
|
||||
register_chipv7_phy(init_data, calibration_data, mode);
|
||||
coex_bt_high_prio();
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_init();
|
||||
#endif
|
||||
}
|
||||
s_phy_rf_init_count++;
|
||||
_lock_release(&s_phy_rf_init_lock);
|
||||
@@ -81,6 +86,10 @@ esp_err_t esp_phy_rf_deinit(void)
|
||||
pm_close_rf();
|
||||
// Disable WiFi peripheral clock
|
||||
CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x87cf);
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_deinit();
|
||||
#endif
|
||||
}
|
||||
s_phy_rf_init_count--;
|
||||
_lock_release(&s_phy_rf_init_lock);
|
||||
|
Reference in New Issue
Block a user