From f7a62030b88f34e020782dfda8effc78637e556f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 2 Apr 2018 23:55:59 +0200 Subject: [PATCH] Using WIFI_NONE_SLEEP by default --- code/espurna/config/general.h | 10 +++++----- code/espurna/wifi.ino | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index d631234c..1b08b812 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -333,12 +333,12 @@ PROGMEM const char* const custom_reset_string[] = { // WIFI // ----------------------------------------------------------------------------- -#define WIFI_CONNECT_TIMEOUT 60000 // Connecting timeout for WIFI in ms -#define WIFI_RECONNECT_INTERVAL 180000 // If could not connect to WIFI, retry after this time in ms -#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations +#define WIFI_CONNECT_TIMEOUT 60000 // Connecting timeout for WIFI in ms +#define WIFI_RECONNECT_INTERVAL 180000 // If could not connect to WIFI, retry after this time in ms +#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations #define WIFI_AP_MODE AP_MODE_ALONE -#define WIFI_SLEEP_ENABLED 1 // Enable WiFi light sleep -#define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting +#define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP +#define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting // Optional hardcoded configuration (up to 2 networks) #ifndef WIFI1_SSID diff --git a/code/espurna/wifi.ino b/code/espurna/wifi.ino index 263115f9..6ca1ed66 100644 --- a/code/espurna/wifi.ino +++ b/code/espurna/wifi.ino @@ -405,9 +405,7 @@ void wifiRegister(wifi_callback_f callback) { void wifiSetup() { - #if WIFI_SLEEP_ENABLED - wifi_set_sleep_type(LIGHT_SLEEP_T); - #endif + WiFi.setSleepMode(WIFI_SLEEP_MODE); _wifiInject(); _wifiConfigure();