Skip to content

Commit 573ce66

Browse files
committed
Clearly disabling DEBUG macros for megaavr architecture.
1 parent 1656ab0 commit 573ce66

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

src/AIoTC_Config.h

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@
3131
#endif
3232

3333
#if defined(ARDUINO_AVR_UNO_WIFI_REV2)
34-
/* Define debug macros which effectively removes them from the
35-
* the codebase for Arduino Uno WiFi. Rev. 2.
36-
*/
37-
# define DEBUG_ERROR
38-
# define DEBUG_WARNING
39-
# define DEBUG_INFO
40-
# define DEBUG_DEBUG
41-
# define DEBUG_VERBOSE
4234
/* Provide defines for constants provided within Arduino_DebugUtils
4335
* in order to allow older sketches using those constants to still
4436
* compile.
@@ -52,23 +44,43 @@
5244
#endif
5345

5446
#ifndef DEBUG_ERROR
55-
#define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__)
47+
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
48+
# define DEBUG_ERROR(fmt, ...)
49+
# else
50+
# define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__)
51+
# endif
5652
#endif
5753

5854
#ifndef DEBUG_WARNING
59-
#define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__)
55+
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
56+
# define DEBUG_WARNING(fmt, ...)
57+
# else
58+
# define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__)
59+
# endif
6060
#endif
6161

6262
#ifndef DEBUG_INFO
63-
#define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__)
63+
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
64+
# define DEBUG_INFO(fmt, ...)
65+
# else
66+
# define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__)
67+
# endif
6468
#endif
6569

6670
#ifndef DEBUG_DEBUG
67-
#define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__)
71+
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
72+
# define DEBUG_DEBUG(fmt, ...)
73+
# else
74+
# define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__)
75+
# endif
6876
#endif
6977

7078
#ifndef DEBUG_VERBOSE
71-
#define DEBUG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
79+
# if defined(ARDUINO_AVR_UNO_WIFI_REV2)
80+
# define DEBUG_VERBOSE(fmt, ...)
81+
# else
82+
# define DEBUG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
83+
# endif
7284
#endif
7385

7486
/******************************************************************************

0 commit comments

Comments
 (0)