From 265991eacde3251d25a38f43342d5453ddd562b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 27 Apr 2018 09:27:22 +0200 Subject: [PATCH] Move debug defines to their own header --- code/espurna/config/all.h | 1 + code/espurna/config/debug.h | 17 +++++++++++++++++ code/espurna/config/dependencies.h | 16 ---------------- code/espurna/config/general.h | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 code/espurna/config/debug.h diff --git a/code/espurna/config/all.h b/code/espurna/config/all.h index 3581bb66..39d2bef9 100644 --- a/code/espurna/config/all.h +++ b/code/espurna/config/all.h @@ -33,6 +33,7 @@ #include "sensors.h" #include "progmem.h" #include "dependencies.h" +#include "debug.h" #ifdef USE_CORE_VERSION_H #include "core_version.h" diff --git a/code/espurna/config/debug.h b/code/espurna/config/debug.h new file mode 100644 index 00000000..3f70386d --- /dev/null +++ b/code/espurna/config/debug.h @@ -0,0 +1,17 @@ +#pragma once + +// ----------------------------------------------------------------------------- +// Debug +// ----------------------------------------------------------------------------- + +#define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT || DEBUG_WEB_SUPPORT + +#if DEBUG_SUPPORT + #define DEBUG_MSG(...) debugSend(__VA_ARGS__) + #define DEBUG_MSG_P(...) debugSend_P(__VA_ARGS__) +#endif + +#ifndef DEBUG_MSG + #define DEBUG_MSG(...) + #define DEBUG_MSG_P(...) +#endif diff --git a/code/espurna/config/dependencies.h b/code/espurna/config/dependencies.h index 73d46e1b..21361e61 100644 --- a/code/espurna/config/dependencies.h +++ b/code/espurna/config/dependencies.h @@ -48,19 +48,3 @@ #undef NTP_SUPPORT #define NTP_SUPPORT 1 // Scheduler needs NTP #endif - -// ----------------------------------------------------------------------------- -// Debug -// ----------------------------------------------------------------------------- - -#define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT || DEBUG_WEB_SUPPORT - -#if DEBUG_SUPPORT - #define DEBUG_MSG(...) debugSend(__VA_ARGS__) - #define DEBUG_MSG_P(...) debugSend_P(__VA_ARGS__) -#endif - -#ifndef DEBUG_MSG - #define DEBUG_MSG(...) - #define DEBUG_MSG_P(...) -#endif diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 8bebbe4b..eb2377ce 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -128,7 +128,7 @@ #define SYSTEM_CHECK_ENABLED 1 // Enable crash check by default #endif -#ifndef SYSTEM_CHECK_MAX +#ifndef SYSTEM_CHECK_TIME #define SYSTEM_CHECK_TIME 60000 // The system is considered stable after these many millis #endif