esp_wifi: Move esp32 DPORT access wrappers into esp_wifi component

This commit is contained in:
Angus Gratton 2019-11-21 13:44:00 +11:00 committed by Angus Gratton
parent b63d28730c
commit 459b3195ac
3 changed files with 21 additions and 16 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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,