Make debug printouts be PRINTF() statements to avoid including them in non-debug builds

This commit is contained in:
Adam Dunkels 2016-10-31 22:11:15 +01:00
parent bb071a7fba
commit 6ab9822fc2

View file

@ -29,6 +29,9 @@
*
*/
#define DEBUG DEBUG_NONE
#include "net/ip/uip-debug.h"
#include "contiki.h"
#include "sys/cc.h"
#include "contiki-net.h"
@ -37,10 +40,8 @@
#include "tcp-socket.h"
#include <stdio.h>
#include <string.h>
static void relisten(struct tcp_socket *s);
LIST(socketlist);
@ -80,7 +81,7 @@ acked(struct tcp_socket *s)
s->output_data_maxlen - s->output_data_send_nxt);
}
if(s->output_data_len < s->output_data_send_nxt) {
printf("tcp: acked assertion failed s->output_data_len (%d) < s->output_data_send_nxt (%d)\n",
PRINTF("tcp: acked assertion failed s->output_data_len (%d) < s->output_data_send_nxt (%d)\n",
s->output_data_len,
s->output_data_send_nxt);
tcp_markconn(uip_conn, NULL);
@ -121,7 +122,7 @@ newdata(struct tcp_socket *s)
bytesleft = 0;
}
if(bytesleft > 0) {
printf("tcp: newdata, bytesleft > 0 (%d) not implemented\n", bytesleft);
PRINTF("tcp: newdata, bytesleft > 0 (%d) not implemented\n", bytesleft);
}
dataptr += copylen;
len -= copylen;