Skip to content

Commit 91f7345

Browse files
committed
Wait connection only if ESP8266 board
1 parent 016b3b8 commit 91f7345

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Arduino_WiFiConnectionHandler.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
******************************************************************************/
2929
#if defined(ARDUINO_ARCH_ESP8266)
3030
static int const ESP_WIFI_CONNECTION_TIMEOUT = 3000;
31-
#elif defined(ARDUINO_ARCH_ESP32)
32-
static int const ESP_WIFI_CONNECTION_TIMEOUT = 1000;
3331
#endif
3432

3533
/******************************************************************************
@@ -93,7 +91,6 @@ NetworkConnectionState WiFiConnectionHandler::update_handleInit()
9391
#else
9492
WiFi.mode(WIFI_STA);
9593
#endif /* #if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32) */
96-
9794
return NetworkConnectionState::CONNECTING;
9895
}
9996

@@ -102,7 +99,7 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
10299
if (WiFi.status() != WL_CONNECTED)
103100
{
104101
WiFi.begin(_ssid, _pass);
105-
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
102+
#if defined(ARDUINO_ARCH_ESP8266)
106103
/* Wait connection otherwise board won't connect */
107104
unsigned long start = millis();
108105
while((WiFi.status() != WL_CONNECTED) && (millis() - start) < ESP_WIFI_CONNECTION_TIMEOUT) {

0 commit comments

Comments
 (0)