From: Fabrice Desclaux Date: Tue, 21 Feb 2012 18:33:28 +0000 (+0100) Subject: xbee_proto: replace printf printf_P X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=decf72af3888e8412fb0c7ccab71607682eb5973;p=protos%2Fxbee-avr.git xbee_proto: replace printf printf_P --- diff --git a/xbee_proto.c b/xbee_proto.c index bd284dd..05f0b56 100644 --- a/xbee_proto.c +++ b/xbee_proto.c @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -138,7 +139,7 @@ static int xbee_proto_parse_frame(struct xbee_dev *dev) /* check frame len */ if (len < (hdrlen + 1)) { dev->stats.rx_frame_too_small++; - fprintf(stderr, "Frame too small\n"); + fprintf_P(stderr, PSTR("Frame too small\r\n")); return -1; } @@ -147,7 +148,7 @@ static int xbee_proto_parse_frame(struct xbee_dev *dev) cksum += ((uint8_t *)buf)[i]; cksum = 0xff - cksum; if (cksum != ((uint8_t *)buf)[len-1]) { - fprintf(stderr, "Invalid cksum\n"); + fprintf_P(stderr, PSTR("Invalid cksum\r\n")); dev->stats.rx_invalid_cksum++; return -1; } @@ -273,7 +274,8 @@ int xbee_proto_xmit(struct xbee_dev *dev, uint8_t channel_id, uint8_t type, case XBEE_TYPE_RMT_ATRESP: default: dev->stats.tx_invalid_type ++; - fprintf(stderr, "unhandled xmit type=%x\n", hdr.type); + fprintf_P(stderr, PSTR("unhandled xmit type=%x\r\n"), + hdr.type); return -1; }