From d7990987538f41785970f064ec9bb987f9014604 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Thu, 3 Sep 2009 11:44:56 +0000 Subject: [PATCH] Put debug message at right place. --- src/rs232.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rs232.c b/src/rs232.c index 34c0d8a..afbde4a 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -86,6 +86,8 @@ serial_port rs232_open(const char* pcPortName) * @note ARYGON-APDB (PN532): 115200,n,8,1 */ /** @todo provide this settings dynamically */ +#define DEBUG__TRY_ARYGON_APDB + #ifdef DEBUG__TRY_ARYGON_APDB cfsetispeed(&(sp->tiNew), B115200); cfsetospeed(&(sp->tiNew), B115200); @@ -138,9 +140,10 @@ bool rs232_receive(const serial_port sp, byte_t* pbtRx, uint32_t* puiRxLen) if (iResult == 0) { // Test if we at least have received something - if (uiCount == 0) return false; - - DBG("RX time-out."); + if (uiCount == 0) { + DBG("RX time-out without received data."); + return false; + } // Store the received byte count and return succesful *puiRxLen = uiCount;