diff --git a/src/core/init.c b/src/core/init.c index c53dbbc2..6a1efe17 100644 --- a/src/core/init.c +++ b/src/core/init.c @@ -99,6 +99,9 @@ #if (PPP_SUPPORT && (NO_SYS==1)) #error "If you want to use PPP, you have to define NO_SYS=0 in your lwipopts.h" #endif +#if (LWIP_NETIF_API && (NO_SYS==1)) + #error "If you want to use NETIF API, you have to define NO_SYS=0 in your lwipopts.h" +#endif #if ((LWIP_SOCKET || LWIP_NETCONN) && (NO_SYS==1)) #error "If you want to use Sequential API, you have to define NO_SYS=0 in your lwipopts.h" #endif diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c index bef32de9..d00cda48 100644 --- a/src/core/ipv4/autoip.c +++ b/src/core/ipv4/autoip.c @@ -193,7 +193,7 @@ autoip_bind(struct netif *netif) struct autoip *autoip = netif->autoip; struct ip_addr sn_mask, gw_addr; - LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_bind(netif=%p) %c%c%"U16_F" 0x%08"X32_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num, autoip->llipaddr)); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_bind(netif=%p) %c%c%"U16_F" 0x%08"X32_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num, autoip->llipaddr.addr)); IP4_ADDR(&sn_mask, 255, 255, 0, 0); IP4_ADDR(&gw_addr, 0, 0, 0, 0); diff --git a/src/core/memp.c b/src/core/memp.c index 0e1d7943..4d44164c 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -117,6 +117,13 @@ static const u16_t memp_num[MEMP_MAX] = { #include "lwip/memp_std.h" }; +#ifdef LWIP_DEBUG +static const char *memp_desc[MEMP_MAX] = { +#define LWIP_MEMPOOL(name,num,size,desc) (desc), +#include "lwip/memp_std.h" +}; +#endif /* LWIP_DEBUG */ + static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) ) #include "lwip/memp_std.h" @@ -303,7 +310,7 @@ memp_malloc(memp_t type) ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0); memp = (struct memp*)((u8_t*)memp + MEMP_SIZE); } else { - LWIP_DEBUGF(MEMP_DEBUG | 2, ("memp_malloc: out of memory in pool %"S16_F"\n", type)); + LWIP_DEBUGF(MEMP_DEBUG | 2, ("memp_malloc: out of memory in pool %s\n", memp_desc[type])); #if MEMP_STATS ++lwip_stats.memp[type].err; #endif /* MEMP_STATS */ diff --git a/src/include/lwip/debug.h b/src/include/lwip/debug.h index 306c4d10..82ea0222 100644 --- a/src/include/lwip/debug.h +++ b/src/include/lwip/debug.h @@ -76,7 +76,18 @@ /** print debug message only if debug message type is enabled... * AND is of correct type AND is at least LWIP_DBG_LEVEL */ -#define LWIP_DEBUGF(debug,x) do { if (((debug) & LWIP_DBG_ON) && ((debug) & LWIP_DBG_TYPES_ON) && ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if ((debug) & LWIP_DBG_HALT) while(1); } } while(0) +#define LWIP_DEBUGF(debug,x) do { \ + if ( \ + ((debug) & LWIP_DBG_ON) && \ + ((debug) & LWIP_DBG_TYPES_ON) && \ + ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ + LWIP_PLATFORM_DIAG(x); \ + if ((debug) & LWIP_DBG_HALT) { \ + while(1); \ + } \ + } \ + } while(0) + #else /* LWIP_DEBUG */ #define LWIP_DEBUGF(debug,x) #endif /* LWIP_DEBUG */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 39d79059..57e2b271 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -540,7 +540,7 @@ * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) */ #ifndef LWIP_UDPLITE -#define LWIP_UDPLITE 1 +#define LWIP_UDPLITE 0 #endif /**