Skip to content
Snippets Groups Projects
Unverified Commit 2f3d811e authored by Marian Buschsieweke's avatar Marian Buschsieweke
Browse files

drivers: Improved debug output in cc110x

parent 30c79a66
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,10 @@
#include "cpu_conf.h"
#include "cpu.h"
#ifdef MODULE_OD
#include "od.h"
#endif
#include "log.h"
#define ENABLE_DEBUG (0)
......@@ -140,11 +144,10 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
int crc_ok = (status[I_LQI] & CRC_OK) >> 7;
if (crc_ok) {
LOG_DEBUG("cc110x: received packet from=%u to=%u payload "
"len=%u\n",
(unsigned)pkt_buf->packet.phy_src,
(unsigned)pkt_buf->packet.address,
pkt_buf->packet.length-3);
LOG_DEBUG("cc110x: received packet from=%u to=%u payload len=%u\n",
(unsigned)pkt_buf->packet.phy_src,
(unsigned)pkt_buf->packet.address,
pkt_buf->packet.length - 3);
/* let someone know that we've got a packet */
callback(arg);
......@@ -153,6 +156,10 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
else {
DEBUG("%s:%s:%u crc-error\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
dev->cc110x_statistic.packets_in_crc_fail++;
#if defined(MODULE_OD) && ENABLE_DEBUG
od_hex_dump(pkt_buf->packet.data, pkt_buf->packet.length - 3,
OD_WIDTH_DEFAULT);
#endif
_rx_abort(dev);
}
}
......@@ -160,7 +167,6 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
static void _rx_continue(cc110x_t *dev, void(*callback)(void*), void*arg)
{
if (dev->radio_state != RADIO_RX_BUSY) {
DEBUG("%s:%s:%u _rx_continue in invalid state\n", RIOT_FILE_RELATIVE,
__func__, __LINE__);
......
......@@ -103,7 +103,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
"length %u\n",
(unsigned)cc110x_pkt.phy_src,
(unsigned)cc110x_pkt.address,
(unsigned)cc110x_pkt.length);
(unsigned)payload_len);
#if defined(MODULE_OD) && ENABLE_DEBUG
od_hex_dump(cc110x_pkt.data, payload_len, OD_WIDTH_DEFAULT);
#endif
return dev->driver->send(dev, &iolist);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment