Skip to content

Commit cde34da

Browse files
Imrpove DEBUG macro definitions
- avoid redundant definition - incorporate a noop to avoid issues
1 parent 48e8c8d commit cde34da

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Arduino_Portenta_OTA_Debug.h

+11-10
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@
2626
#if __has_include (<Arduino_DebugUtils.h>)
2727
#include <Arduino_DebugUtils.h>
2828
#else
29-
#define DEBUG_ERROR(fmt, ...)
30-
#define DEBUG_WARNING(fmt, ...)
31-
#define DEBUG_INFO(fmt, ...)
32-
#define DEBUG_DEBUG(fmt, ...)
33-
#define DEBUG_VERBOSE(fmt, ...)
29+
#define ARDUINO_PORTENTA_OTA_NO_DEBUG
3430
#endif
3531
#else
36-
#define DEBUG_ERROR(fmt, ...)
37-
#define DEBUG_WARNING(fmt, ...)
38-
#define DEBUG_INFO(fmt, ...)
39-
#define DEBUG_DEBUG(fmt, ...)
40-
#define DEBUG_VERBOSE(fmt, ...)
32+
#define ARDUINO_PORTENTA_OTA_NO_DEBUG
33+
#endif
34+
35+
#ifdef ARDUINO_PORTENTA_OTA_NO_DEBUG
36+
#define DEBUG_ERROR(fmt, ...) ((void)0)
37+
#define DEBUG_WARNING(fmt, ...) ((void)0)
38+
#define DEBUG_INFO(fmt, ...) ((void)0)
39+
#define DEBUG_DEBUG(fmt, ...) ((void)0)
40+
#define DEBUG_VERBOSE(fmt, ...) ((void)0)
4141
#endif
42+
#undef ARDUINO_PORTENTA_OTA_NO_DEBUG
4243

4344
#endif /* ARDUINO_PORTENTA_OTA_DEBUG_H_ */

0 commit comments

Comments
 (0)