lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] using LWIP_DEBUG


From: Francois Bouchard
Subject: Re: [lwip-users] using LWIP_DEBUG
Date: Thu, 28 May 2009 17:34:36 -0400

This is great!  So now the lwip debug is working.  Does it allow tracing too?
FB
----- Original Message -----
Sent: Thursday, May 28, 2009 4:46 PM
Subject: Fw: [lwip-users] using LWIP_DEBUG

Problem resolved!
 
It was a problem in cc.h wich I dont quite understand really.
Problem occured with LWIP_PLATFORM_DIAG in LWIP_DEBUGF.
 
I was given the code so I dont know on what purpose it was not well write.
 
Here is what was making all the trouble.
 
//Orignial LWIP_PLATFORM_DIAG wich was doing the error
//#define LWIP_PLATFORM_DIAG( x, ... ) do{ sys_debug( x );} while( 0 )
#define LWIP_PLATFORM_DIAG( x ) sys_debug x
 
--------------------------------------------------
void sys_debug( const char *const fmt, ... )
{
 printf(fmt); 
}
 
-------------------------------------------------
 
------------------------------------------------------------------
What was calling LWIP_PLATFORM_DIAG is LWIP_DEBUGF
------------------------------------------------------------------
#ifdef LWIP_DEBUG
/** 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) { \
                 for (;;)\
                 {\
                 \
                 }\
              } \
            } \
     } while(0)
 
#else  /* LWIP_DEBUG */
#define LWIP_DEBUGF(debug,x)
#endif /* LWIP_DEBUG */
 
-------------------------------------------------------------
 
If anyone have an idea on why there was a bug with the original version.
Im not really good with macro yet and I wish to learn. Thanks!
 
Alexandre Malo


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

[Prev in Thread] Current Thread [Next in Thread]