8000 Update to the last version of nonos-sdk V2, WiFi addons by d-a-v · Pull Request #5210 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Update to the last version of nonos-sdk V2, WiFi addons #5210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
when not using listenInterval, set wifi sleep level to min
  • Loading branch information
d-a-v committed Oct 8, 2018
commit 3f0c601cfe81439ce17e9bd5d28994a7ed144482
33 changes: 20 additions & 13 deletions libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,28 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
DEBUG_WIFI_GENERIC("listenInterval not usable with WIFI_NONE_SLEEP\n");
#endif

if (listenInterval && (type == WIFI_LIGHT_SLEEP || type == WIFI_MODEM_SLEEP)) {
if (!wifi_set_sleep_level(MAX_SLEEP_T)) {
DEBUG_WIFI_GENERIC("wifi_set_sleep_level(MAX_SLEEP_T): error\n");
return false;
}
if (listenInterval > 10) {
DEBUG_WIFI_GENERIC("listenInterval must be in [1..10]\n");
if (type == WIFI_LIGHT_SLEEP || type == WIFI_MODEM_SLEEP) {
if (listenInterval) {
if (!wifi_set_sleep_level(MAX_SLEEP_T)) {
DEBUG_WIFI_GENERIC("wifi_set_sleep_level(MAX_SLEEP_T): error\n");
return false;
}
if (listenInterval > 10) {
DEBUG_WIFI_GENERIC("listenInterval must be in [1..10]\n");
#ifndef DEBUG_ESP_WIFI
// stay within datasheet range when not in debug mode
listenInterval = 10;
// stay within datasheet range when not in debug mode
listenInterval = 10;
#endif
}
if (!wifi_set_listen_interval(listenInterval)) {
DEBUG_WIFI_GENERIC("wifi_set_listen_interval(%d): error\n", listenInterval);
return false;
}
if (!wifi_set_listen_interval(listenInterval)) {
DEBUG_WIFI_GENERIC("wifi_set_listen_interval(%d): error\n", listenInterval);
return false;
}
} else {
if (!wifi_set_sleep_level(MIN_SLEEP_T)) {
DEBUG_WIFI_GENERIC("wifi_set_sleep_level(MIN_SLEEP_T): error\n");
return false;
}
}
}
bool ret = wifi_set_sleep_type((sleep_type_t) type);
Expand Down
4 changes: 2 additions & 2 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class ESP8266WiFiSTAClass {

protected:

static bool _useStaticIp;
static bool _useInsecureWEP;
static bool _useStaticIp;
static bool _useInsecureWEP;

// ----------------------------------------------------------------------------------------------
// ------------------------------------ STA remote configure -----------------------------------
Expand Down
0