Skip to content

Commit 4406b4d

Browse files
committed
fix: use setAutoReconnect for ESP8266 and ESP32 only
1 parent 8b7f44c commit 4406b4d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/NetWizard.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,12 @@ void NetWizard::removeParameter(NetWizardParameter* parameter) {
411411
}
412412

413413
void NetWizard::_connect(const char* ssid, const char* password, bool autoreconnect) {
414-
// Set auto reconnect
415-
if (autoreconnect) {
416-
WiFi.setAutoReconnect(true);
417-
}
414+
#if defined(ESP8266) || defined(ESP32)
415+
// Set auto reconnect
416+
if (autoreconnect) {
417+
WiFi.setAutoReconnect(true);
418+
}
419+
#endif
418420
// Set hostname
419421
WiFi.setHostname(_nw.hostname.c_str());
420422
// Connect to WiFi

0 commit comments

Comments
 (0)