1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

debug: removed superfluous additional debug flag

This commit is contained in:
Oleg Hahm 2014-12-03 22:59:14 +01:00
parent e9426ef9ab
commit c92effaead
18 changed files with 37 additions and 66 deletions

View File

@ -27,9 +27,6 @@
#include "msg.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
at86rf231_packet_t at86rf231_rx_buffer[AT86RF231_RX_BUF_SIZE];
@ -65,7 +62,7 @@ void at86rf231_rx_handler(void)
return;
}
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("pkg: ");
for (int i = 1; i < at86rf231_rx_buffer[rx_buffer_next].length; i++) {
DEBUG("%x ", buf[i]);
@ -79,7 +76,7 @@ void at86rf231_rx_handler(void)
/* if packet is no ACK */
if (at86rf231_rx_buffer[rx_buffer_next].frame.fcf.frame_type != IEEE_802154_ACK_FRAME) {
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
ieee802154_frame_print_fcf_frame(&at86rf231_rx_buffer[rx_buffer_next].frame);
#endif
if (at86rf231_raw_packet_cb != NULL) {
@ -99,7 +96,7 @@ void at86rf231_rx_handler(void)
}
else {
/* This should not happen, ACKs are consumed by hardware */
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("GOT ACK for SEQ %u\n", at86rf231_rx_buffer[rx_buffer_next].frame.seq_nr);
ieee802154_frame_print_fcf_frame(&at86rf231_rx_buffer[rx_buffer_next].frame);
#endif

View File

@ -21,9 +21,6 @@
#include "msg.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
/* circular buffer for incoming 802.15.4 packets */
@ -78,7 +75,7 @@ void cc2420_rx_handler(void)
/* follow-up to transceiver module if adequate */
if (cc2420_rx_buffer[rx_buffer_next].frame.fcf.frame_type != IEEE_802154_ACK_FRAME) {
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
ieee802154_frame_print_fcf_frame(&cc2420_rx_buffer[rx_buffer_next].frame);
#endif
@ -91,7 +88,7 @@ void cc2420_rx_handler(void)
}
}
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
else {
DEBUG("GOT ACK for SEQ %u\n", cc2420_rx_buffer[rx_buffer_next].frame.seq_nr);
ieee802154_frame_print_fcf_frame(&cc2420_rx_buffer[rx_buffer_next].frame);

View File

@ -83,9 +83,6 @@
#endif
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
#ifndef CONF_RADIO_ADDR
@ -145,7 +142,7 @@ void auto_init_net_if(void)
memcpy(&(eui64.uint32[1]), &hash_l, sizeof(uint32_t));
net_if_set_eui64(iface, &eui64);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("Auto init radio long address on interface %d to ", iface);
for (size_t i = 0; i < 8; i++) {
@ -153,7 +150,7 @@ void auto_init_net_if(void)
}
DEBUG("\n");
#endif /* DEBUG_ENABLED */
#endif /* ENABLE_DEBUG */
#undef CONF_RADIO_ADDR
#if (defined(MODULE_CC110X) || defined(MODULE_CC110X_LEGACY) || defined(MODULE_CC110X_LEGACY_CSMA))

View File

@ -23,9 +23,6 @@
#include "netapi.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
int netapi_send_command(kernel_pid_t pid, netapi_cmd_t *cmd)

View File

@ -19,9 +19,6 @@
#include "ieee802154_frame.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
#define IEEE_802154_FCS_POLY (0x8408) /* x^16 + x^12 + x^5 + 1 for LSB first */
@ -105,7 +102,7 @@ uint8_t ieee802154_frame_init(ieee802154_frame_t *frame, uint8_t *buf)
index += 8;
}
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("INFO: IEEE 802.15.4 header initialized:\n");
for (size_t i = 0; i < index; i++) {

View File

@ -24,14 +24,11 @@
#include "net_help.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
net_if_t interfaces[NET_IF_MAX];
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
void print_addr_hex(net_if_addr_t *addr)
{
int i;

View File

@ -33,9 +33,6 @@
#include "net_help.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
#define LLHDR_ICMPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN + ICMPV6_HDR_LEN)
@ -268,7 +265,7 @@ void icmpv6_send_echo_request(ipv6_addr_t *destaddr, uint16_t id, uint16_t seq,
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send echo request (id = %04x, seq = %d, data_len = %zu) to: %s\n",
id, seq, data_len, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -307,7 +304,7 @@ void icmpv6_send_echo_reply(ipv6_addr_t *destaddr, uint16_t id, uint16_t seq, ui
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send echo reply (id = %04x, seq = %d, data_len = %zu) to: %s\n",
id, seq, data_len, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -364,7 +361,7 @@ void icmpv6_send_router_sol(uint8_t sllao)
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send router solicitation to: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -380,7 +377,7 @@ void recv_echo_req(void)
uint8_t *echo_data_buf = ((uint8_t *)echo_buf) + sizeof(icmpv6_echo_reply_hdr_t);
size_t data_len = NTOHS(ipv6_buf->length) - ICMPV6_HDR_LEN - ECHO_REQ_LEN;
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: received echo request from: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -404,7 +401,7 @@ void recv_echo_req(void)
void recv_echo_repl(void)
{
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
ipv6_buf = ipv6_get_buf();
icmpv6_echo_reply_hdr_t *echo_buf = get_echo_repl_buf(ipv6_ext_hdr_len);
uint8_t *echo_data_buf = ((uint8_t *)echo_buf) + sizeof(icmpv6_echo_reply_hdr_t);
@ -693,7 +690,7 @@ void icmpv6_send_router_adv(ipv6_addr_t *addr, uint8_t sllao, uint8_t mtu, uint8
/* calculate checksum */
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send router advertisement to: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -984,7 +981,7 @@ void icmpv6_send_neighbor_sol(ipv6_addr_t *src, ipv6_addr_t *dest, ipv6_addr_t *
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send neighbor solicitation to: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -1258,7 +1255,7 @@ void icmpv6_send_neighbor_adv(ipv6_addr_t *src, ipv6_addr_t *dst, ipv6_addr_t *t
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send neighbor advertisement to: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -1478,7 +1475,7 @@ void icmpv6_send_parameter_prob(ipv6_addr_t *src, ipv6_addr_t *dest,
icmp_buf->checksum = icmpv6_csum(ipv6_buf, icmp_buf);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("INFO: send parameter problem to: %s\n",
ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
@ -1521,7 +1518,7 @@ int ndp_addr_is_on_link(ipv6_addr_t *dest_addr)
int if_id = -1;
if ((ndp_neighbor_cache_search(dest_addr))) {
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
DEBUG("INFO: %s is in nbr cache\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, dest_addr));
#endif

View File

@ -36,7 +36,6 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
char addr_str[IPV6_MAX_ADDR_STR_LEN];
#endif
#include "debug.h"

View File

@ -48,7 +48,6 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
char addr_str[IPV6_MAX_ADDR_STR_LEN];
#endif
#include "debug.h"
@ -172,7 +171,7 @@ int sixlowpan_lowpan_sendto(int if_id, const void *dest, int dest_len,
/* check if packet needs to be fragmented */
DEBUG("sixlowpan_lowpan_sendto(%d, dest, %d, data, %"PRIu16")\n",
if_id, dest_len, data_len);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("dest: ");
if (dest_len == 8) {
@ -299,7 +298,7 @@ void sixlowpan_lowpan_set_iphc_status(
iphc_status = status;
}
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
void print_long_local_addr(net_if_eui64_t *saddr)
{
printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",

View File

@ -37,9 +37,6 @@
#include "net_help.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#endif
#include "debug.h"
#define RADIO_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
@ -98,7 +95,7 @@ static void *recv_ieee802154_frame(void *arg)
length = p->length - hdrlen - IEEE_802154_FCS_LEN;
#endif
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
DEBUG("INFO: Received IEEE 802.15.4. packet (length = %d):\n", length);
DEBUG("INFO: FCF:\n");
ieee802154_frame_print_fcf_frame(&frame);
@ -182,7 +179,7 @@ void set_ieee802154_fcf_values(ieee802154_frame_t *frame, uint8_t dest_mode,
frame->fcf.frame_ver = 0;
frame->fcf.src_addr_m = src_mode;
frame->fcf.dest_addr_m = dest_mode;
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
ieee802154_frame_print_fcf_frame(frame);
#endif
}

View File

@ -37,7 +37,7 @@ static void _write_packet(struct rfc5444_writer *wr __attribute__ ((unused)),
struct rfc5444_writer_target *iface __attribute__((unused)),
void *buffer, size_t length);
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
char addr_str[IPV6_MAX_ADDR_STR_LEN];
static struct netaddr_str nbuf;
#endif

View File

@ -27,7 +27,7 @@
extern "C" {
#endif
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
#define ENABLE_AODV_DEBUG (1)
#endif

View File

@ -67,7 +67,7 @@ static struct unreachable_node unreachable_nodes[AODVV2_MAX_UNREACHABLE_NODES];
static int num_unreachable_nodes;
static struct rfc5444_reader reader;
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
static struct netaddr_str nbuf;
#endif
@ -192,7 +192,7 @@ static enum rfc5444_result _cb_rreq_blocktlv_messagetlvs_okay(struct rfc5444_rea
*/
static enum rfc5444_result _cb_rreq_blocktlv_addresstlvs_okay(struct rfc5444_reader_tlvblock_context *cont)
{
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
struct netaddr_str nbuf;
#endif
struct rfc5444_reader_tlvblock_entry *tlv;
@ -411,7 +411,7 @@ static enum rfc5444_result _cb_rrep_blocktlv_messagetlvs_okay(struct rfc5444_rea
*/
static enum rfc5444_result _cb_rrep_blocktlv_addresstlvs_okay(struct rfc5444_reader_tlvblock_context *cont)
{
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
struct netaddr_str nbuf;
#endif
struct rfc5444_reader_tlvblock_entry *tlv;
@ -479,7 +479,7 @@ static enum rfc5444_result _cb_rrep_end_callback(
VDEBUG("%s()\n", __func__);
struct aodvv2_routing_entry_t *rt_entry;
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
struct netaddr_str nbuf;
#endif
timex_t now;
@ -563,7 +563,7 @@ static enum rfc5444_result _cb_rrep_end_callback(
earlier RREQ, and RREP processing is completed. Any packets
buffered for OrigNode should be transmitted. */
if (clienttable_is_client(&packet_data.origNode.addr)) {
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
static struct netaddr_str nbuf2;
#endif
@ -609,7 +609,7 @@ static enum rfc5444_result _cb_rerr_blocktlv_messagetlvs_okay(struct rfc5444_rea
static enum rfc5444_result _cb_rerr_blocktlv_addresstlvs_okay(struct rfc5444_reader_tlvblock_context *cont)
{
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
struct netaddr_str nbuf;
#endif
struct aodvv2_routing_entry_t *unreachable_entry;

View File

@ -30,7 +30,7 @@ static void _reset_entry_if_stale(uint8_t i);
static struct aodvv2_routing_entry_t routing_table[AODVV2_MAX_ROUTING_ENTRIES];
static timex_t null_time, max_seqnum_lifetime, active_interval, max_idletime, validity_t;
timex_t now;
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
static struct netaddr_str nbuf;
#endif
@ -79,7 +79,7 @@ struct aodvv2_routing_entry_t *routingtable_get_entry(struct netaddr *addr,
if (!netaddr_cmp(&routing_table[i].addr, addr)
&& routing_table[i].metricType == metricType) {
DEBUG("[routing] found entry for %s :", netaddr_to_string(&nbuf, addr));
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
print_routingtable_entry(&routing_table[i]);
#endif
return &routing_table[i];

View File

@ -36,7 +36,7 @@ static void _reset_entry_if_stale(uint8_t i);
static struct netaddr client_table[AODVV2_MAX_CLIENTS];
static struct aodvv2_rreq_entry rreq_table[AODVV2_RREQ_BUF];
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
static struct netaddr_str nbuf;
#endif
static timex_t null_time, now, _max_idletime;

View File

@ -27,7 +27,6 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
char addr_str_mode[IPV6_MAX_ADDR_STR_LEN];
#endif
#include "debug.h"

View File

@ -28,7 +28,6 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
char addr_str_mode[IPV6_MAX_ADDR_STR_LEN];
#endif
#include "debug.h"

View File

@ -66,7 +66,6 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED
#undef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#endif
@ -593,7 +592,7 @@ void receive_cc2420_packet(ieee802154_packet_t *trans_p)
trans_p->frame.payload_len = p->frame.payload_len;
eINT();
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
if (trans_p->frame.fcf.dest_addr_m == IEEE_802154_SHORT_ADDR_M) {
if (trans_p->frame.fcf.src_addr_m == IEEE_802154_SHORT_ADDR_M) {
@ -686,7 +685,7 @@ void receive_at86rf231_packet(ieee802154_packet_t *trans_p)
trans_p->frame.payload_len = p->frame.payload_len;
eINT();
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
if (trans_p->frame.fcf.dest_addr_m == IEEE_802154_SHORT_ADDR_M) {
if (trans_p->frame.fcf.src_addr_m == IEEE_802154_SHORT_ADDR_M) {
@ -727,7 +726,7 @@ static int8_t send_packet(transceiver_type_t t, void *pkt)
#if MODULE_AT86RF231 || MODULE_CC2420 || MODULE_MC1322X
ieee802154_packet_t *p = (ieee802154_packet_t *)pkt;
DEBUG("transceiver: Send packet to ");
#ifdef DEBUG_ENABLED
#if ENABLE_DEBUG
for (size_t i = 0; i < 8; i++) {
printf("%02x ", p->frame.dest_addr[i]);