Build: Handle WiFi & BT enabled/disabled combos gracefully as possible

If using WIFI_INIT_CONFIG_DEFAULT, error message will point out lack
of WiFi. Otherwise linker errors on WiFi symbols should help give a
clue as to what is broken.

Piggy-backs on changes in !420, ref github #230 #237
This commit is contained in:
Angus Gratton
2017-01-16 11:52:15 +11:00
parent f20135af54
commit ea19838d3a
6 changed files with 22 additions and 12 deletions

View File

@@ -62,6 +62,7 @@
#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"
@@ -97,11 +98,14 @@ typedef struct {
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