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
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to