Merge branch 'bugfix/fix_some_esp32_host_issues_v5.3' into 'release/v5.3'

Bugfix/fix some esp32 host issues(Backport v5.3)

See merge request espressif/esp-idf!32681
This commit is contained in:
Jiang Jiang Jian
2024-09-09 17:28:52 +08:00
6 changed files with 46 additions and 4 deletions

View File

@@ -53,6 +53,10 @@ extern void wifi_apb80m_request(void);
extern void wifi_apb80m_release(void);
#endif
#if CONFIG_ESP_EXT_CONN_ENABLE
extern uint8_t *esp_extconn_get_mac(void);
#endif
IRAM_ATTR void *wifi_malloc(size_t size)
{
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
@@ -427,7 +431,26 @@ static void esp_log_write_wrapper(unsigned int level, const char *tag, const cha
static esp_err_t esp_read_mac_wrapper(uint8_t *mac, unsigned int type)
{
if (mac == NULL) {
ESP_LOGE(TAG, "mac address param is NULL");
return ESP_ERR_INVALID_ARG;
}
// get mac address from target
#if CONFIG_ESP_EXT_CONN_ENABLE
memcpy(mac, esp_extconn_get_mac(), 6);
#else
ESP_LOGE(TAG, "Not support read mac");
return ESP_FAIL;
#endif
if (type == ESP_MAC_WIFI_SOFTAP) {
mac[5] += 1;
}
ESP_LOGD(TAG, "%s MAC addr: " MACSTR, (type == ESP_MAC_WIFI_STA ? "STA" : "AP"), MAC2STR(mac));
return ESP_OK;
}
static int coex_init_wrapper(void)