Skip to content

Commit 6e0e75f

Browse files
committed
Automatically include Arduino_DebugUtils if any of the debug macros is actually defined, i.e. if any debug output is enabled on the platform.
1 parent 86b1170 commit 6e0e75f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/AIoTC_Config.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@
3030
#define NTP_USE_RANDOM_PORT (1)
3131
#endif
3232

33-
#if defined(ARDUINO_AVR_UNO_WIFI_REV2)
34-
/* Provide defines for constants provided within Arduino_DebugUtils
35-
* in order to allow older sketches using those constants to still
36-
* compile.
37-
*/
38-
# define DBG_NONE -1
39-
# define DBG_ERROR 0
40-
# define DBG_WARNING 1
41-
# define DBG_INFO 2
42-
# define DBG_DEBUG 3
43-
# define DBG_VERBOSE 4
44-
#endif
45-
4633
#ifndef DEBUG_ERROR
4734
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
4835
# define DEBUG_ERROR(fmt, ...)
@@ -83,6 +70,19 @@
8370
# endif
8471
#endif
8572

73+
#if defined(ARDUINO_AVR_UNO_WIFI_REV2) && !(defined(DEBUG_ERROR) || defined(DEBUG_WARNING) || defined(DEBUG_INFO) || defined(DEBUG_DEBUG) || defined(DEBUG_VERBOSE))
74+
/* Provide defines for constants provided within Arduino_DebugUtils
75+
* in order to allow older sketches using those constants to still
76+
* compile.
77+
*/
78+
# define DBG_NONE -1
79+
# define DBG_ERROR 0
80+
# define DBG_WARNING 1
81+
# define DBG_INFO 2
82+
# define DBG_DEBUG 3
83+
# define DBG_VERBOSE 4
84+
#endif
85+
8686
/******************************************************************************
8787
* AUTOMATICALLY CONFIGURED DEFINES
8888
******************************************************************************/

src/ArduinoIoTCloud.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <Arduino_ConnectionHandler.h>
2828

29-
#if !defined(__AVR__)
29+
#if defined(DEBUG_ERROR) || defined(DEBUG_WARNING) || defined(DEBUG_INFO) || defined(DEBUG_DEBUG) || defined(DEBUG_VERBOSE)
3030
# include <Arduino_DebugUtils.h>
3131
#endif
3232

0 commit comments

Comments
 (0)