#
COMPONENT_SRCDIRS := . hwcrypto
+LIBS := core rtc phy
+ifdef CONFIG_BT_ENABLED
+LIBS += coexist
+endif
+ifdef CONFIG_WIFI_ENABLED
+LIBS += net80211 pp wpa smartconfig coexist wps wpa2
+endif
-LIBS := core net80211 phy rtc pp wpa smartconfig coexist wps wpa2
+LIBS := $(sort $(LIBS)) # de-duplicate, we can handle different orders here
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "rom/queue.h"
+#include "sdkconfig.h"
#include "esp_err.h"
#include "esp_wifi_types.h"
#include "esp_event.h"
uint32_t rx_buf_num; /**< WiFi RX buffer number */
} wifi_init_config_t;
-
+#ifdef CONFIG_WIFI_ENABLED
#define WIFI_INIT_CONFIG_DEFAULT() { \
.event_handler = &esp_event_send, \
.rx_buf_num = CONFIG_ESP32_WIFI_RX_BUFFER_NUM, \
};
+#else
+#define WIFI_INIT_CONFIG_DEFAULT #error Wifi is disabled in config, WIFI_INIT_CONFIG_DEFAULT will not work
+#endif
/**
* @brief Init WiFi
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "esp_log.h"
+#include "sdkconfig.h"
#include "rom/efuse.h"
#include "rom/cache.h"
#include "rom/uart.h"
void IRAM_ATTR esp_restart(void)
{
+#ifdef CONFIG_WIFI_ENABLED
esp_wifi_stop();
+#endif
// Disable scheduler on this core.
vTaskSuspendAll();
--- /dev/null
+# Disable WiFi stack by default
+CONFIG_WIFI_ENABLED=n
# Override some defaults so BT stack is enabled
-# in this example
-
-#
-# BT config
-#
+# and WiFi disabled by default in this example
CONFIG_BT_ENABLED=y
+CONFIG_WIFI_ENABLED=n
# Override some defaults so BT stack is enabled
-# in this example
-
-#
-# BT config
-#
+# and WiFi disabled by default in this example
CONFIG_BT_ENABLED=y
+CONFIG_WIFI_ENABLED=n