fixed debug output and changed to use uip-debug.h for debug output

This commit is contained in:
Niclas Finne 2012-01-27 15:51:46 +01:00
parent c3655728b8
commit 1e85183754

View file

@ -83,16 +83,8 @@
/* For Debug, logging, statistics */ /* For Debug, logging, statistics */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define DEBUG 0 #define DEBUG DEBUG_NONE
#if DEBUG #include "net/uip-debug.h"
#include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__)
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",lladdr->addr[0], lladdr->addr[1], lladdr->addr[2], lladdr->addr[3],lladdr->addr[4], lladdr->addr[5])
#else
#define PRINTF(...)
#define PRINT6ADDR(addr)
#endif
#if UIP_CONF_IPV6_RPL #if UIP_CONF_IPV6_RPL
#include "rpl/rpl.h" #include "rpl/rpl.h"
@ -1459,7 +1451,7 @@ uip_process(u8_t flag)
if(UIP_UDP_BUF->udpchksum != 0 && uip_udpchksum() != 0xffff) { if(UIP_UDP_BUF->udpchksum != 0 && uip_udpchksum() != 0xffff) {
UIP_STAT(++uip_stat.udp.drop); UIP_STAT(++uip_stat.udp.drop);
UIP_STAT(++uip_stat.udp.chkerr); UIP_STAT(++uip_stat.udp.chkerr);
printf("udp: bad checksum 0x%04x 0x%04x\n", UIP_UDP_BUF->udpchksum, PRINTF("udp: bad checksum 0x%04x 0x%04x\n", UIP_UDP_BUF->udpchksum,
uip_udpchksum()); uip_udpchksum());
goto drop; goto drop;
} }