diff --git a/components/esp32/dport_access.c b/components/esp32/dport_access.c index ca8902801..aa5b4913f 100644 --- a/components/esp32/dport_access.c +++ b/components/esp32/dport_access.c @@ -144,15 +144,6 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_end(void) #endif /* CONFIG_FREERTOS_UNICORE */ } -void IRAM_ATTR esp_dport_access_stall_other_cpu_start_wrap(void) -{ - DPORT_STALL_OTHER_CPU_START(); -} - -void IRAM_ATTR esp_dport_access_stall_other_cpu_end_wrap(void) -{ - DPORT_STALL_OTHER_CPU_END(); -} #ifndef CONFIG_FREERTOS_UNICORE static void dport_access_init_core(void *arg) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 17fe54ed2..dc855d93a 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -8,6 +8,13 @@ else() set(ldfragments "linker.lf") endif() +if(IDF_TARGET_ESP32) + # dport workaround headers are in esp32 component + set(extra_priv_requires esp32) +else() + set(extra_priv_requires) +endif() + idf_component_register(SRCS "src/coexist.c" "src/lib_printf.c" "src/mesh_event.c" @@ -20,7 +27,7 @@ idf_component_register(SRCS "src/coexist.c" "${idf_target}/esp_adapter.c" INCLUDE_DIRS "include" "${idf_target}/include" REQUIRES esp_event - PRIV_REQUIRES wpa_supplicant nvs_flash esp_netif + PRIV_REQUIRES wpa_supplicant nvs_flash esp_netif ${extra_priv_requires} LDFRAGMENTS "${ldfragments}") idf_build_get_property(build_dir BUILD_DIR) diff --git a/components/esp_wifi/esp32/esp_adapter.c b/components/esp_wifi/esp32/esp_adapter.c index 410a73025..99ccd1434 100644 --- a/components/esp_wifi/esp32/esp_adapter.c +++ b/components/esp_wifi/esp32/esp_adapter.c @@ -44,13 +44,20 @@ #include "esp_smartconfig.h" #include "esp_coexist_internal.h" #include "esp_coexist_adapter.h" - - -extern void esp_dport_access_stall_other_cpu_start_wrap(void); -extern void esp_dport_access_stall_other_cpu_end_wrap(void); +#include "esp32/dport_access.h" #define TAG "esp_adapter" +static void IRAM_ATTR s_esp_dport_access_stall_other_cpu_start(void) +{ + DPORT_STALL_OTHER_CPU_START(); +} + +static void IRAM_ATTR s_esp_dport_access_stall_other_cpu_end(void) +{ + DPORT_STALL_OTHER_CPU_END(); +} + /* If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. If failed, try to allocate it in internal memory then. @@ -557,8 +564,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { ._event_post = esp_event_post_wrapper, ._get_free_heap_size = esp_get_free_heap_size, ._rand = esp_random, - ._dport_access_stall_other_cpu_start_wrap = esp_dport_access_stall_other_cpu_start_wrap, - ._dport_access_stall_other_cpu_end_wrap = esp_dport_access_stall_other_cpu_end_wrap, + ._dport_access_stall_other_cpu_start_wrap = s_esp_dport_access_stall_other_cpu_start, + ._dport_access_stall_other_cpu_end_wrap = s_esp_dport_access_stall_other_cpu_end, ._phy_rf_deinit = esp_phy_rf_deinit, ._phy_load_cal_and_init = esp_phy_load_cal_and_init, ._phy_common_clock_enable = esp_phy_common_clock_enable,