From c52ef1d2b35eb2d901e81522fb746890df23d215 Mon Sep 17 00:00:00 2001 From: fbernon Date: Sat, 22 Sep 2007 11:16:07 +0000 Subject: [PATCH] Minor changes for debug (indent, and set LWIP_DBG_TYPES_ON to LWIP_DBG_ON to have all traces selected display per default, in the same spirit that LWIP_DBG_MIN_LEVEL is set per default to LWIP_DBG_LEVEL_OFF) --- src/include/lwip/debug.h | 23 +++++++++++------------ src/include/lwip/opt.h | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/include/lwip/debug.h b/src/include/lwip/debug.h index 82ea0222..8070027d 100644 --- a/src/include/lwip/debug.h +++ b/src/include/lwip/debug.h @@ -40,26 +40,25 @@ * - 2 serious * - 3 severe */ - -#define LWIP_DBG_LEVEL_OFF 0 -#define LWIP_DBG_LEVEL_WARNING 1 /* bad checksums, dropped packets, ... */ -#define LWIP_DBG_LEVEL_SERIOUS 2 /* memory allocation failures, ... */ -#define LWIP_DBG_LEVEL_SEVERE 3 /* */ -#define LWIP_DBG_MASK_LEVEL 3 +#define LWIP_DBG_LEVEL_OFF 0x00 +#define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */ +#define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */ +#define LWIP_DBG_LEVEL_SEVERE 0x03 +#define LWIP_DBG_MASK_LEVEL 0x03 /** flag for LWIP_DEBUGF to enable that debug message */ -#define LWIP_DBG_ON 0x80U +#define LWIP_DBG_ON 0x80U /** flag for LWIP_DEBUGF to disable that debug message */ -#define LWIP_DBG_OFF 0x00U +#define LWIP_DBG_OFF 0x00U /** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ -#define LWIP_DBG_TRACE 0x40U +#define LWIP_DBG_TRACE 0x40U /** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ -#define LWIP_DBG_STATE 0x20U +#define LWIP_DBG_STATE 0x20U /** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ -#define LWIP_DBG_FRESH 0x10U +#define LWIP_DBG_FRESH 0x10U /** flag for LWIP_DEBUGF to halt after printing this debug message */ -#define LWIP_DBG_HALT 0x08U +#define LWIP_DBG_HALT 0x08U #ifndef LWIP_NOASSERT #define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0) diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 57e2b271..54e4a9b5 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -1244,12 +1244,21 @@ ---------- Debugging options ---------- --------------------------------------- */ +/** + * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is + * compared against this value. If it is smaller, then debugging + * messages are written. + */ +#ifndef LWIP_DBG_MIN_LEVEL +#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF +#endif + /** * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable * debug messages of certain types. */ #ifndef LWIP_DBG_TYPES_ON -#define LWIP_DBG_TYPES_ON 0 +#define LWIP_DBG_TYPES_ON LWIP_DBG_ON #endif /** @@ -1477,13 +1486,4 @@ #define SNMP_MIB_DEBUG LWIP_DBG_OFF #endif -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - */ -#ifndef LWIP_DBG_MIN_LEVEL -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF -#endif - #endif /* __LWIP_OPT_H__ */