From: Fabrice Desclaux Date: Tue, 21 Feb 2012 18:31:19 +0000 (+0100) Subject: xbee_stat: replace printf printf_P X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=57f427bf97cd67963a9470f5552a6956cf9a89ef;p=protos%2Fxbee-avr.git xbee_stat: replace printf printf_P --- diff --git a/xbee_stats.c b/xbee_stats.c index 6e3c403..7913325 100644 --- a/xbee_stats.c +++ b/xbee_stats.c @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -52,30 +53,30 @@ void xbee_reset_stats(struct xbee_dev *dev) //XXX printf_P void xbee_dump_stats(struct xbee_dev *dev) { - printf("statistics on xbee_dev %p:\n", dev); - printf(" rx_frame: %d\n", dev->stats.rx_frame); - printf(" rx_atresp: %d\n", dev->stats.rx_atresp); - printf(" rx_atresp_error: %d\n", dev->stats.rx_atresp_error); - printf(" rx_modem_status: %d\n", dev->stats.rx_modem_status); - printf(" rx_xmit_status: %d\n", dev->stats.rx_xmit_status); - printf(" rx_xmit_status_error: %d\n", dev->stats.rx_xmit_status_error); - printf(" rx_data: %d\n", dev->stats.rx_data); - printf(" rx_expl_data: %d\n", dev->stats.rx_expl_data); - printf(" rx_node_id: %d\n", dev->stats.rx_node_id); - printf(" rx_rmt_atresp: %d\n", dev->stats.rx_rmt_atresp); - printf(" rx_rmt_atresp_error: %d\n", dev->stats.rx_rmt_atresp_error); - printf(" rx_frame_too_small: %d\n", dev->stats.rx_frame_too_small); - printf(" rx_frame_too_large: %d\n", dev->stats.rx_frame_too_large); - printf(" rx_invalid_cksum: %d\n", dev->stats.rx_invalid_cksum); - printf(" rx_invalid_type: %d\n", dev->stats.rx_invalid_type); - printf(" rx_no_delim: %d\n", dev->stats.rx_no_delim); - printf(" tx_frame: %d\n", dev->stats.tx_frame); - printf(" tx_atcmd: %d\n", dev->stats.tx_atcmd); - printf(" tx_atcmd_q: %d\n", dev->stats.tx_atcmd_q); - printf(" tx_data: %d\n", dev->stats.tx_data); - printf(" tx_expl_data: %d\n", dev->stats.tx_expl_data); - printf(" tx_xmit_retries: %d\n", dev->stats.tx_xmit_retries); - printf(" tx_rmt_atcmd: %d\n", dev->stats.tx_rmt_atcmd); - printf(" tx_invalid_type: %d\n", dev->stats.tx_invalid_type); - printf(" tx_invalid_channel: %d\n", dev->stats.tx_invalid_channel); + printf_P(PSTR("statistics on xbee_dev %p:\r\n"), dev); + printf_P(PSTR(" rx_frame: %d\r\n"), dev->stats.rx_frame); + printf_P(PSTR(" rx_atresp: %d\r\n"), dev->stats.rx_atresp); + printf_P(PSTR(" rx_atresp_error: %d\r\n"), dev->stats.rx_atresp_error); + printf_P(PSTR(" rx_modem_status: %d\r\n"), dev->stats.rx_modem_status); + printf_P(PSTR(" rx_xmit_status: %d\r\n"), dev->stats.rx_xmit_status); + printf_P(PSTR(" rx_xmit_status_error: %d\r\n"), dev->stats.rx_xmit_status_error); + printf_P(PSTR(" rx_data: %d\r\n"), dev->stats.rx_data); + printf_P(PSTR(" rx_expl_data: %d\r\n"), dev->stats.rx_expl_data); + printf_P(PSTR(" rx_node_id: %d\r\n"), dev->stats.rx_node_id); + printf_P(PSTR(" rx_rmt_atresp: %d\r\n"), dev->stats.rx_rmt_atresp); + printf_P(PSTR(" rx_rmt_atresp_error: %d\r\n"), dev->stats.rx_rmt_atresp_error); + printf_P(PSTR(" rx_frame_too_small: %d\r\n"), dev->stats.rx_frame_too_small); + printf_P(PSTR(" rx_frame_too_large: %d\r\n"), dev->stats.rx_frame_too_large); + printf_P(PSTR(" rx_invalid_cksum: %d\r\n"), dev->stats.rx_invalid_cksum); + printf_P(PSTR(" rx_invalid_type: %d\r\n"), dev->stats.rx_invalid_type); + printf_P(PSTR(" rx_no_delim: %d\r\n"), dev->stats.rx_no_delim); + printf_P(PSTR(" tx_frame: %d\r\n"), dev->stats.tx_frame); + printf_P(PSTR(" tx_atcmd: %d\r\n"), dev->stats.tx_atcmd); + printf_P(PSTR(" tx_atcmd_q: %d\r\n"), dev->stats.tx_atcmd_q); + printf_P(PSTR(" tx_data: %d\r\n"), dev->stats.tx_data); + printf_P(PSTR(" tx_expl_data: %d\r\n"), dev->stats.tx_expl_data); + printf_P(PSTR(" tx_xmit_retries: %d\r\n"), dev->stats.tx_xmit_retries); + printf_P(PSTR(" tx_rmt_atcmd: %d\r\n"), dev->stats.tx_rmt_atcmd); + printf_P(PSTR(" tx_invalid_type: %d\r\n"), dev->stats.tx_invalid_type); + printf_P(PSTR(" tx_invalid_channel: %d\r\n"), dev->stats.tx_invalid_channel); }