|
34 | 34 | #define NTP_USE_RANDOM_PORT (1) |
35 | 35 | #endif |
36 | 36 |
|
37 | | -#ifndef DEBUG_ERROR |
38 | | - #define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) |
39 | | -#endif |
40 | | - |
41 | | -#ifndef DEBUG_WARNING |
42 | | - #define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) |
43 | | -#endif |
44 | | - |
45 | | -#ifndef DEBUG_INFO |
46 | | - #define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) |
47 | | -#endif |
48 | | - |
49 | | -#ifndef DEBUG_DEBUG |
50 | | - #define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) |
| 37 | +#if defined __has_include |
| 38 | + #if !__has_include (<Arduino_DebugUtils.h>) |
| 39 | + #define DEBUG_ERROR (void) 0 |
| 40 | + #define DEBUG_WARNING (void) 0 |
| 41 | + #define DEBUG_INFO (void) 0 |
| 42 | + #define DEBUG_DEBUG (void) 0 |
| 43 | + #define DEBUG_VERBOSE (void) 0 |
| 44 | + #endif |
51 | 45 | #endif |
52 | 46 |
|
53 | | -#ifndef DEBUG_VERBOSE |
54 | | - #define DEBUG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) |
55 | | -#endif |
| 47 | +// include directives must be ordered in such a way that this always comes first, |
| 48 | +// otherwise the log level will be incorrectly set |
| 49 | +#ifndef DEBUG_LEVEL |
| 50 | + #define DEBUG_LEVEL DEBUG_LEVEL_INFO |
| 51 | +#endif // DEBUG_LEVEL |
| 52 | +// #include <Arduino_DebugUtils.h> |
56 | 53 |
|
57 | 54 | /****************************************************************************** |
58 | 55 | * AUTOMATICALLY CONFIGURED DEFINES |
|
0 commit comments