diff --git a/src/esp8266/esp_wifi.c b/src/esp8266/esp_wifi.c index a84d12e..5d28591 100644 --- a/src/esp8266/esp_wifi.c +++ b/src/esp8266/esp_wifi.c @@ -23,6 +23,7 @@ #include #else #include +#include "version.h" #if MGOS_ESP8266_WIFI_ENABLE_WPAENT #include #endif @@ -175,7 +176,11 @@ static bool mgos_wifi_remove_mode(uint8_t mode) { bool mgos_wifi_dev_sta_setup(const struct mgos_config_wifi_sta *cfg) { struct station_config sta_cfg = { - .all_channel_scan = mgos_sys_config_get_wifi_sta_all_chan_scan(), +#if ESP_SDK_VERSION_MAJOR >= 3 + .all_channel_scan = mgos_sys_config_get_wifi_sta_all_chan_scan(), +#else + 0 +#endif }; if (!cfg->enable) {