Skip to content

Commit f476884

Browse files
committed
Use ARDUINO_ARCH_ESP32 instead of ESP32 to align defines strategy
1 parent 78b21c2 commit f476884

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Diff for: src/Arduino_ConnectionHandler.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@
8585
#define WIFI_FIRMWARE_VERSION_REQUIRED WIFI_FIRMWARE_REQUIRED
8686
#endif
8787

88-
#if defined(ESP32)
89-
#include <WiFi.h>
90-
#include <WiFiUdp.h>
91-
#define BOARD_HAS_WIFI
92-
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
93-
#define NETWORK_IDLE_STATUS WL_IDLE_STATUS
94-
#define NETWORK_CONNECTED WL_CONNECTED
95-
#define WIFI_FIRMWARE_VERSION_REQUIRED WIFI_FIRMWARE_REQUIRED
96-
88+
#if defined(ARDUINO_ARCH_ESP32)
89+
#include <WiFi.h>
90+
#include <WiFiUdp.h>
91+
92+
#define BOARD_HAS_WIFI
93+
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
94+
#define NETWORK_IDLE_STATUS WL_IDLE_STATUS
95+
#define NETWORK_CONNECTED WL_CONNECTED
96+
#define WIFI_FIRMWARE_VERSION_REQUIRED WIFI_FIRMWARE_REQUIRED
9797
#endif
9898

9999
/******************************************************************************

Diff for: src/Arduino_WiFiConnectionHandler.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ WiFiConnectionHandler::WiFiConnectionHandler(char const * ssid, char const * pas
4141

4242
unsigned long WiFiConnectionHandler::getTime()
4343
{
44-
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ESP32)
44+
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
4545
return WiFi.getTime();
4646
#else
4747
return 0;
@@ -54,7 +54,7 @@ unsigned long WiFiConnectionHandler::getTime()
5454

5555
NetworkConnectionState WiFiConnectionHandler::update_handleInit()
5656
{
57-
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ESP32)
57+
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
5858
#if !defined(__AVR__)
5959
Debug.print(DBG_INFO, F("WiFi.status(): %d"), WiFi.status());
6060
#endif
@@ -87,19 +87,19 @@ NetworkConnectionState WiFiConnectionHandler::update_handleInit()
8787
delay(300);
8888
WiFi.begin(_ssid, _pass);
8989
delay(1000);
90-
#endif /* #if !defined(ARDUINO_ARCH_ESP8266) && !defined(ESP32) */
90+
#endif /* #if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32) */
9191

9292
return NetworkConnectionState::CONNECTING;
9393
}
9494

9595
NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
9696
{
97-
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ESP32)
97+
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
9898
if (WiFi.status() != WL_CONNECTED)
9999
{
100100
WiFi.begin(_ssid, _pass);
101101
}
102-
#endif /* ifndef ARDUINO_ARCH_ESP8266 */
102+
#endif /* #if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32) */
103103

104104
if (WiFi.status() != NETWORK_CONNECTED)
105105
{
@@ -114,7 +114,7 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
114114
#if !defined(__AVR__)
115115
Debug.print(DBG_INFO, F("Connected to \"%s\""), _ssid);
116116
#endif
117-
#if defined(ARDUINO_ARCH_ESP8266) || defined(ESP32)
117+
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
118118
configTime(0, 0, "time.arduino.cc", "pool.ntp.org", "time.nist.gov");
119119
#endif
120120
return NetworkConnectionState::CONNECTED;
@@ -149,9 +149,9 @@ NetworkConnectionState WiFiConnectionHandler::update_handleDisconnecting()
149149

150150
NetworkConnectionState WiFiConnectionHandler::update_handleDisconnected()
151151
{
152-
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ESP32)
152+
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
153153
WiFi.end();
154-
#endif /* ifndef ARDUINO_ARCH_ESP8266 */
154+
#endif /* #if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32) */
155155
if (_keep_alive)
156156
{
157157
return NetworkConnectionState::INIT;

0 commit comments

Comments
 (0)