Skip to content

Commit 39d4468

Browse files
authored
Merge pull request #44 from arduino-libraries/disable-debug-utils-for-uno-wifi-rev2
Disable Arduino_DebugUtils for Arduino Uno WiFi Rev 2
2 parents 441c04e + 57c21d7 commit 39d4468

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Arduino_ConnectionHandler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@
118118
INCLUDES
119119
******************************************************************************/
120120

121-
#include <Arduino_DebugUtils.h>
121+
#if !defined(__AVR__)
122+
# include <Arduino_DebugUtils.h>
123+
#endif
122124

123125
/******************************************************************************
124126
TYPEDEFS

src/Arduino_WiFiConnectionHandler.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,28 @@ unsigned long WiFiConnectionHandler::getTime()
5555
NetworkConnectionState WiFiConnectionHandler::update_handleInit()
5656
{
5757
#ifndef BOARD_ESP8266
58+
#if !defined(__AVR__)
5859
Debug.print(DBG_INFO, F("WiFi.status(): %d"), WiFi.status());
60+
#endif
5961
if (WiFi.status() == NETWORK_HARDWARE_ERROR)
6062
{
63+
#if !defined(__AVR__)
6164
Debug.print(DBG_ERROR, F("WiFi Hardware failure.\nMake sure you are using a WiFi enabled board/shield."));
6265
Debug.print(DBG_ERROR, F("Then reset and retry."));
66+
#endif
6367
return NetworkConnectionState::ERROR;
6468
}
65-
69+
#if !defined(__AVR__)
6670
Debug.print(DBG_ERROR, F("Current WiFi Firmware: %s"), WiFi.firmwareVersion());
71+
#endif
6772

6873
#if defined(WIFI_FIRMWARE_VERSION_REQUIRED)
6974
if (WiFi.firmwareVersion() < WIFI_FIRMWARE_VERSION_REQUIRED)
7075
{
76+
#if !defined(__AVR__)
7177
Debug.print(DBG_ERROR, F("Latest WiFi Firmware: %s"), WIFI_FIRMWARE_VERSION_REQUIRED);
7278
Debug.print(DBG_ERROR, F("Please update to the latest version for best performance."));
79+
#endif
7380
delay(5000);
7481
}
7582
#endif
@@ -96,13 +103,17 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
96103

97104
if (WiFi.status() != NETWORK_CONNECTED)
98105
{
106+
#if !defined(__AVR__)
99107
Debug.print(DBG_ERROR, F("Connection to \"%s\" failed"), _ssid);
100108
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
109+
#endif
101110
return NetworkConnectionState::CONNECTING;
102111
}
103112
else
104113
{
114+
#if !defined(__AVR__)
105115
Debug.print(DBG_INFO, F("Connected to \"%s\""), _ssid);
116+
#endif
106117
#ifdef BOARD_ESP8266
107118
configTime(0, 0, "time.arduino.cc", "pool.ntp.org", "time.nist.gov");
108119
#endif
@@ -114,12 +125,15 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected()
114125
{
115126
if (WiFi.status() != WL_CONNECTED)
116127
{
128+
#if !defined(__AVR__)
117129
Debug.print(DBG_VERBOSE, F("WiFi.status(): %d"), WiFi.status());
118130
Debug.print(DBG_ERROR, F("Connection to \"%s\" lost."), _ssid);
119-
131+
#endif
120132
if (_keep_alive)
121133
{
134+
#if !defined(__AVR__)
122135
Debug.print(DBG_ERROR, F("Attempting reconnection"));
136+
#endif
123137
}
124138

125139
return NetworkConnectionState::DISCONNECTED;

0 commit comments

Comments
 (0)