From 6d38cd1c2f6075d36da2a2a8112af4593bc846f4 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 15 Mar 2018 18:35:01 +0100 Subject: fixed debug print --- code/fe310/eos/ecp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'code/fe310') diff --git a/code/fe310/eos/ecp.c b/code/fe310/eos/ecp.c index 9301555..61f834a 100644 --- a/code/fe310/eos/ecp.c +++ b/code/fe310/eos/ecp.c @@ -1,5 +1,6 @@ #include #include +#include #include "encoding.h" #include "platform.h" @@ -40,7 +41,14 @@ static void packet_handler(unsigned char cmd, unsigned char *buffer, uint16_t le memcpy(addr.host, buffer, sizeof(addr.host)); memcpy(&addr.port, buffer+sizeof(addr.host), sizeof(addr.port)); ssize_t rv = ecp_pkt_handle(_sock, &addr, NULL, &bufs, len-addr_len); - if (rv < 0) DPRINT(rv, "ERR:packet_handler - RV:%d\n", rv); +#ifdef ECP_DEBUG + if (rv < 0) { + char b[16]; + puts("ERR:"); + puts(itoa(rv, b, 10)); + puts("\n"); + } +#endif if (bufs.packet->buffer) eos_net_free(buffer, 0); eos_net_release(0); } -- cgit v1.2.3