Skip to content

Commit

Permalink
don't include esp_wifi.h unless you've enabled wifi in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
edmund-huber committed Mar 19, 2017
1 parent 57486a1 commit 903b75b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/esp32/include/esp_wifi.h
Expand Up @@ -54,6 +54,10 @@
*
*/

#ifndef CONFIG_WIFI_ENABLED
#error To use Wifi, you need to enable Wifi in the config
#endif

#ifndef __ESP_WIFI_H__
#define __ESP_WIFI_H__

Expand Down Expand Up @@ -123,7 +127,6 @@ typedef struct {
#endif

#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
#ifdef CONFIG_WIFI_ENABLED
#define WIFI_INIT_CONFIG_DEFAULT() { \
.event_handler = &esp_event_send, \
.static_rx_buf_num = CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM,\
Expand All @@ -134,9 +137,6 @@ typedef struct {
.nano_enable = WIFI_NANO_FORMAT_ENABLED,\
.magic = WIFI_INIT_CONFIG_MAGIC\
};
#else
#define WIFI_INIT_CONFIG_DEFAULT #error Wifi is disabled in config, WIFI_INIT_CONFIG_DEFAULT will not work
#endif

/**
* @brief Init WiFi
Expand Down

0 comments on commit 903b75b

Please sign in to comment.