mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-12-10 08:46:40 +08:00
make asserts independent of debug, make lwipopts override debug.h
This commit is contained in:
parent
3122375323
commit
2b6f48cc09
@ -120,7 +120,7 @@ static u8_t memp_memory[(MEMP_NUM_PBUF *
|
|||||||
static sys_sem_t mutex;
|
static sys_sem_t mutex;
|
||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#ifdef LWIP_DEBUG
|
#ifndef LWIP_NOASSERT
|
||||||
static int
|
static int
|
||||||
memp_sanity(void)
|
memp_sanity(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -61,19 +61,19 @@
|
|||||||
/** flag for LWIP_DEBUGF to halt after printing this debug message */
|
/** flag for LWIP_DEBUGF to halt after printing this debug message */
|
||||||
#define DBG_HALT 0x08U
|
#define DBG_HALT 0x08U
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
#ifndef LWIP_NOASSERT
|
||||||
# ifndef LWIP_NOASSERT
|
|
||||||
# define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0)
|
# define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0)
|
||||||
# else
|
#else
|
||||||
# define LWIP_ASSERT(x,y)
|
# define LWIP_ASSERT(x,y)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LWIP_DEBUG
|
||||||
/** print debug message only if debug message type is enabled...
|
/** print debug message only if debug message type is enabled...
|
||||||
* AND is of correct type AND is at least DBG_LEVEL
|
* AND is of correct type AND is at least DBG_LEVEL
|
||||||
*/
|
*/
|
||||||
# define LWIP_DEBUGF(debug,x) do { if (((debug) & DBG_ON) && ((debug) & DBG_TYPES_ON) && (((debug) & DBG_MASK_LEVEL) >= DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if ((debug) & DBG_HALT) while(1); } } while(0)
|
# define LWIP_DEBUGF(debug,x) do { if (((debug) & DBG_ON) && ((debug) & DBG_TYPES_ON) && (((debug) & DBG_MASK_LEVEL) >= DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if ((debug) & DBG_HALT) while(1); } } while(0)
|
||||||
# define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x); } while(0)
|
# define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x); } while(0)
|
||||||
#else /* LWIP_DEBUG */
|
#else /* LWIP_DEBUG */
|
||||||
# define LWIP_ASSERT(x,y)
|
|
||||||
# define LWIP_DEBUGF(debug,x)
|
# define LWIP_DEBUGF(debug,x)
|
||||||
# define LWIP_ERROR(x)
|
# define LWIP_ERROR(x)
|
||||||
#endif /* LWIP_DEBUG */
|
#endif /* LWIP_DEBUG */
|
||||||
|
|||||||
@ -32,9 +32,9 @@
|
|||||||
#ifndef __LWIP_OPT_H__
|
#ifndef __LWIP_OPT_H__
|
||||||
#define __LWIP_OPT_H__
|
#define __LWIP_OPT_H__
|
||||||
|
|
||||||
#include "lwip/debug.h"
|
|
||||||
/* Include user defined options first */
|
/* Include user defined options first */
|
||||||
#include "lwipopts.h"
|
#include "lwipopts.h"
|
||||||
|
#include "lwip/debug.h"
|
||||||
|
|
||||||
/* Define default values for unconfigured parameters. */
|
/* Define default values for unconfigured parameters. */
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user