diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 0844b89578..0f754dcec4 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -1,3 +1,18 @@ +if( NOT CONFIG_ESP_WIFI_ENABLED + AND NOT CMAKE_BUILD_EARLY_EXPANSION ) + # No local wifi: provide only netif bindings + set(srcs + "src/wifi_default.c" + "src/wifi_netif.c" + "src/wifi_default_ap.c") + + # This component provides "esp_wifi" "wifi_apps" headers if WiFi not enabled + # (implementation supported optionally in a managed component esp_wifi_remote) + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "include" "wifi_apps/include") + return() +endif() + if(CONFIG_ESP_WIFI_ENABLED) idf_build_get_property(idf_target IDF_TARGET) diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index d77ae6aa9c..86ebccd032 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -1,8 +1,6 @@ menu "Wi-Fi" - # TODO: Disable WIFI support on ESP32-H2 (WIFI-5796) - # visible if SOC_WIFI_SUPPORTED - + visible if (SOC_WIFI_SUPPORTED) config ESP_WIFI_ENABLED bool default y if SOC_WIFI_SUPPORTED diff --git a/components/wifi_provisioning/CMakeLists.txt b/components/wifi_provisioning/CMakeLists.txt index fd8b1cb0f8..a04450ca71 100644 --- a/components/wifi_provisioning/CMakeLists.txt +++ b/components/wifi_provisioning/CMakeLists.txt @@ -1,3 +1,12 @@ + +if( NOT CONFIG_ESP_WIFI_ENABLED + AND NOT CMAKE_BUILD_EARLY_EXPANSION ) + # This component provides only "esp_provisioning" headers if WiFi not enabled + # (implementation supported optionally in a managed component esp_wifi_remote) + idf_component_register(INCLUDE_DIRS include) + return() +endif() + set(srcs "src/wifi_config.c" "src/wifi_scan.c" "src/wifi_ctrl.c" diff --git a/components/wifi_provisioning/Kconfig b/components/wifi_provisioning/Kconfig index 9403d0ee23..273289f36e 100644 --- a/components/wifi_provisioning/Kconfig +++ b/components/wifi_provisioning/Kconfig @@ -1,5 +1,5 @@ menu "Wi-Fi Provisioning Manager" - + visible if (SOC_WIFI_SUPPORTED) config WIFI_PROV_SCAN_MAX_ENTRIES int "Max Wi-Fi Scan Result Entries" default 16 diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 3b50a1db44..0fa0988e03 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -1,5 +1,13 @@ set(linker_fragments linker.lf) +if( NOT CONFIG_ESP_WIFI_ENABLED + AND NOT CMAKE_BUILD_EARLY_EXPANSION ) + # This component provides only "esp_supplicant" headers if WiFi not enabled + # (implementation supported optionally in a managed component esp_wifi_remote) + idf_component_register(INCLUDE_DIRS esp_supplicant/include) + return() +endif() + set(srcs "port/os_xtensa.c" "port/eloop.c" "src/ap/ap_config.c" diff --git a/examples/system/console/advanced/components/cmd_wifi/CMakeLists.txt b/examples/system/console/advanced/components/cmd_wifi/CMakeLists.txt index ca51905567..b529d0328a 100644 --- a/examples/system/console/advanced/components/cmd_wifi/CMakeLists.txt +++ b/examples/system/console/advanced/components/cmd_wifi/CMakeLists.txt @@ -1,3 +1,9 @@ -idf_component_register(SRCS "cmd_wifi.c" +if(CONFIG_ESP_WIFI_ENABLED) + set(srcs "cmd_wifi.c") +else() + set(srcs) +endif() + +idf_component_register(SRCS "${srcs}" INCLUDE_DIRS . REQUIRES console esp_wifi) diff --git a/examples/system/console/advanced/main/console_example_main.c b/examples/system/console/advanced/main/console_example_main.c index 4f7d7cd893..d9856ee38b 100644 --- a/examples/system/console/advanced/main/console_example_main.c +++ b/examples/system/console/advanced/main/console_example_main.c @@ -157,7 +157,7 @@ void app_main(void) esp_console_register_help_command(); register_system_common(); register_system_sleep(); -#if SOC_WIFI_SUPPORTED +#if CONFIG_ESP_WIFI_ENABLED register_wifi(); #endif register_nvs(); diff --git a/examples/system/console/basic/main/console_example_main.c b/examples/system/console/basic/main/console_example_main.c index 34fd94d131..1ee06a33cd 100644 --- a/examples/system/console/basic/main/console_example_main.c +++ b/examples/system/console/basic/main/console_example_main.c @@ -81,7 +81,7 @@ void app_main(void) esp_console_register_help_command(); register_system_common(); register_system_sleep(); -#if SOC_WIFI_SUPPORTED +#if CONFIG_ESP_WIFI_ENABLED register_wifi(); #endif register_nvs(); diff --git a/tools/unit-test-app/configs/default_3_h2 b/tools/unit-test-app/configs/default_3_h2 index 6768e9bbda..ef39a6d847 100644 --- a/tools/unit-test-app/configs/default_3_h2 +++ b/tools/unit-test-app/configs/default_3_h2 @@ -1,3 +1,3 @@ # This config is split between targets since different component needs to be included CONFIG_IDF_TARGET="esp32h2" -TEST_EXCLUDE_COMPONENTS=app_trace esp_eth esp_hid esp_netif esp_phy esp_ringbuf esp_wifi espcoredump hal lwip mdns newlib nvs_flash partition_table sdmmc driver soc spi_flash vfs +TEST_EXCLUDE_COMPONENTS=app_trace esp_eth esp_hid esp_netif esp_phy esp_ringbuf esp_wifi espcoredump hal lwip mdns newlib nvs_flash partition_table sdmmc driver soc spi_flash vfs wpa_supplicant