drivers: Improved debug output in cc110x
This commit is contained in:
parent
30c79a66d0
commit
2f3d811e99
@ -38,6 +38,10 @@
|
|||||||
#include "cpu_conf.h"
|
#include "cpu_conf.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
|
#ifdef MODULE_OD
|
||||||
|
#include "od.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
@ -140,8 +144,7 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
|
|||||||
int crc_ok = (status[I_LQI] & CRC_OK) >> 7;
|
int crc_ok = (status[I_LQI] & CRC_OK) >> 7;
|
||||||
|
|
||||||
if (crc_ok) {
|
if (crc_ok) {
|
||||||
LOG_DEBUG("cc110x: received packet from=%u to=%u payload "
|
LOG_DEBUG("cc110x: received packet from=%u to=%u payload len=%u\n",
|
||||||
"len=%u\n",
|
|
||||||
(unsigned)pkt_buf->packet.phy_src,
|
(unsigned)pkt_buf->packet.phy_src,
|
||||||
(unsigned)pkt_buf->packet.address,
|
(unsigned)pkt_buf->packet.address,
|
||||||
pkt_buf->packet.length - 3);
|
pkt_buf->packet.length - 3);
|
||||||
@ -153,6 +156,10 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
|
|||||||
else {
|
else {
|
||||||
DEBUG("%s:%s:%u crc-error\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
|
DEBUG("%s:%s:%u crc-error\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
|
||||||
dev->cc110x_statistic.packets_in_crc_fail++;
|
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);
|
_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)
|
static void _rx_continue(cc110x_t *dev, void(*callback)(void*), void*arg)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (dev->radio_state != RADIO_RX_BUSY) {
|
if (dev->radio_state != RADIO_RX_BUSY) {
|
||||||
DEBUG("%s:%s:%u _rx_continue in invalid state\n", RIOT_FILE_RELATIVE,
|
DEBUG("%s:%s:%u _rx_continue in invalid state\n", RIOT_FILE_RELATIVE,
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
|
|||||||
@ -103,7 +103,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
|||||||
"length %u\n",
|
"length %u\n",
|
||||||
(unsigned)cc110x_pkt.phy_src,
|
(unsigned)cc110x_pkt.phy_src,
|
||||||
(unsigned)cc110x_pkt.address,
|
(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);
|
return dev->driver->send(dev, &iolist);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user