Skip to content

Commit

Permalink
WiFi: allow button action to also disable softAP (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr authored Oct 16, 2019
1 parent 0a11a74 commit 8dda007
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/espurna/button.ino
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ void buttonEvent(unsigned int id, unsigned char event) {
}

if (BUTTON_MODE_AP == action) {
wifiStartAP();
if (wifiState() & WIFI_STATE_AP) {
wifiStartSTA();
} else {
wifiStartAP();
}
}

if (BUTTON_MODE_RESET == action) {
Expand Down
1 change: 1 addition & 0 deletions code/espurna/wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ void wifiReconnectCheck() {
#if TELNET_SUPPORT
if (telnetConnected()) connected = true;
#endif
jw.enableSTA(true);
jw.setReconnectTimeout(connected ? 0 : WIFI_RECONNECT_INTERVAL);
}

Expand Down

0 comments on commit 8dda007

Please sign in to comment.