Skip to content

Commit 5a7405e

Browse files
committed
Correct LWIP_DEBUG definition
Commit f602c93 incorrectly started defining LWIP_DEBUG as either 0 or 1. lwipopts.h locally was changed to use #if, but all existing users continued to use #ifdef. Therefore defining it to 0 was accidentally enabling it for quite a few users. This would have pulled in some unwanted lwIP code, and affected some drivers, eg k64f_emac.c allocating an extra 2K of stack. Correct lwipopts.h to either define it as 1 or leave it undefined, and change the #if tests back to #ifdef, so all are consistent.
1 parent 4978a08 commit 5a7405e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

features/FEATURE_LWIP/lwip-interface/lwipopts.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@
6969
#error "Either IPv4 or IPv6 must be preferred."
7070
#endif
7171

72-
#if defined(MBED_CONF_LWIP_DEBUG_ENABLED)
73-
#define LWIP_DEBUG MBED_CONF_LWIP_DEBUG_ENABLED
74-
#else
75-
#define LWIP_DEBUG 0
72+
#undef LWIP_DEBUG
73+
#if MBED_CONF_LWIP_DEBUG_ENABLED
74+
#define LWIP_DEBUG 1
7675
#endif
7776

7877
#if NO_SYS == 0
@@ -93,7 +92,7 @@
9392
#define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200
9493
#endif
9594

96-
#if LWIP_DEBUG
95+
#ifdef LWIP_DEBUG
9796
#define TCPIP_THREAD_STACKSIZE MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2
9897
#else
9998
#define TCPIP_THREAD_STACKSIZE MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE
@@ -111,7 +110,7 @@
111110
#define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768
112111
#endif
113112

114-
#if LWIP_DEBUG
113+
#ifdef LWIP_DEBUG
115114
#define DEFAULT_THREAD_STACKSIZE MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2
116115
#define PPP_THREAD_STACK_SIZE MBED_CONF_LWIP_PPP_THREAD_STACKSIZE*2
117116
#else
@@ -250,7 +249,7 @@
250249
#define ETHARP_DEBUG LWIP_DBG_OFF
251250
#define UDP_LPC_EMAC LWIP_DBG_OFF
252251

253-
#if LWIP_DEBUG
252+
#ifdef LWIP_DEBUG
254253
#define MEMP_OVERFLOW_CHECK 1
255254
#define MEMP_SANITY_CHECK 1
256255
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON

0 commit comments

Comments
 (0)