Revert "removed redefined ENABLE_DEBUG"

This reverts commit 69c526f44d.

Instead of removing ENABLE_DEBUG, define it as zero and replacing the
ifdef preprocessor commands by a simple #if
dev/timer
Oleg Hahm 10 years ago
parent 615ddb1eaa
commit 599e266b55

@ -22,7 +22,7 @@
#include <stdio.h>
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)

@ -31,8 +31,6 @@
#include <auto_init.h>
#endif
#include <debug.h>
volatile tcb_t *sched_threads[MAXTHREADS];
volatile tcb_t *active_thread;
volatile int lpm_prevent_sleep = 0;

@ -24,6 +24,8 @@
#include <cib.h>
#include "flags.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#include "thread.h"

@ -20,6 +20,7 @@
#include <string.h>
#include <stdlib.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
extern void *sbrk(int incr);

@ -19,8 +19,6 @@
#include "queue.h"
#include "debug.h"
void queue_remove(queue_node_t *root, queue_node_t *node)
{
while (root->next != NULL) {

@ -21,6 +21,7 @@
#include <clist.h>
#include <bitarithm.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
volatile int num_tasks = 0;

@ -20,6 +20,7 @@
#include "thread.h"
#include "kernel.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#include "kernel_internal.h"
#include "bitarithm.h"

@ -9,6 +9,7 @@
#include <iap.h>
#include <lpc2387.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
/* pointer to reserved flash rom section for configuration data */

@ -35,11 +35,6 @@ void rtc_init(void)
{
/* Set to calendar mode */
RTCCTL1 |= RTCMODE_H;
/* enable ready interrupt (every second) */
#ifndef ENABLE_DEBUG
RTCCTL0 |= RTCRDYIE;
#endif
}
/*---------------------------------------------------------------------------*/

@ -4,7 +4,7 @@
#include <hwtimer_arch.h>
#include <cpu.h>
// #define ENABLE_DEBUG (1)
#define ENABLE_DEBUG (0)
#include <debug.h>
static uint32_t ticks = 0;

@ -27,8 +27,8 @@ License. See the file LICENSE in the top level directory for more details.
#include "lpc23xx.h"
#include "lpc2387-adc.h"
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#include "hwtimer.h"
#include "debug.h"
#endif
@ -101,7 +101,7 @@ void adc_init_2(void)
/*---------------------------------------------------------------------------*/
uint16_t adc_read(uint8_t channel)
{
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
uint32_t t1, t2;
#endif
uint32_t regVal, adc_data;
@ -113,12 +113,12 @@ uint16_t adc_read(uint8_t channel)
/* switch channel, start A/D convert */
AD0CR &= 0xFFFFFF00;
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
t1 = hwtimer_now();
#endif
AD0CR |= (1 << 24) | (1 << channel);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
t2 = hwtimer_now();
#endif

@ -41,7 +41,7 @@ static enum lpm_mode lpm;
extern void init_clks1(void);
extern void init_clks2(void);
#define ENABLE_DEBUG 0
#define ENABLE_DEBUG (0)
#include <debug.h>
void lpm_init(void)
@ -49,7 +49,7 @@ void lpm_init(void)
lpm = LPM_ON;
}
#define LPM_DEBUG 1
#define LPM_DEBUG (1)
void lpm_begin_awake(void)
{
@ -108,9 +108,7 @@ enum lpm_mode lpm_set(enum lpm_mode target)
lpm = target;
#if iENABLE_DEBUG
DEBUG("# LPM power down %u -> %u", lpm, target);
#endif
PCON |= target_flags; // set target power mode
return last_lpm;

@ -18,6 +18,7 @@
#include "hwtimer.h"
#include "diskio.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
extern unsigned long hwtimer_now(void);

@ -35,7 +35,7 @@ License. See the file LICENSE in the top level directory for more details.
#define PREINT_RTC 0x000001C8 /* Prescaler value, integer portion, PCLK = 15Mhz */
#define PREFRAC_RTC 0x000061C0 /* Prescaler value, fraction portion, PCLK = 15Mhz */
#define ENABLE_DEBUG 0
#define ENABLE_DEBUG (0)
#include <debug.h>
/**

@ -16,7 +16,7 @@ License. See the file LICENSE in the top level directory for more details.
#include <hwtimer.h>
#include <hwtimer_arch.h>
// #define ENABLE_DEBUG (1)
#define ENABLE_DEBUG (0)
#include <debug.h>

@ -25,6 +25,7 @@
#include <hwtimer.h>
#include <config.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
/* some externals */

@ -12,6 +12,7 @@
#include <cc2420_arch.h>
#include <hwtimer.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
static uint16_t radio_channel;

@ -46,8 +46,6 @@ and the mailinglist (subscription via web site)
#include <sht11-board.h>
#include <bitarithm.h>
#include <debug.h>
float sht11_temperature_offset;
/**

@ -22,6 +22,7 @@
#include <auto_init.h>
#include "vtimer.h"
#define ENABLE_DEBUG (0)
#include <debug.h>
extern int main(void);

@ -25,6 +25,7 @@
#include <irq.h>
#include <posix_io.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
static int min(int a, int b)

@ -5,7 +5,7 @@
/* Stack size for transceiver thread */
#ifndef TRANSCEIVER_STACK_SIZE
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
#define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_PRINTF)
#else
#define TRANSCEIVER_STACK_SIZE (512)

@ -447,33 +447,27 @@ static uint8_t etx_count_packet_tx(etx_neighbor_t * candidate) {
for (uint8_t i = 0; i < ETX_WINDOW; i++) {
if (i != cur_round) {
pkt_count = pkt_count + candidate->packets_tx[i];
#ifdef ENABLE_DEBUG
DEBUG("%d",candidate->packets_tx[i]);
if (i < ETX_WINDOW - 1) {
DEBUG(",");
}
#endif
} else {
//Check if I received something for the current round
if (candidate->tx_cur_round == 0) {
//Didn't receive a packet, zero the field and don't add
candidate->packets_tx[i] = 0;
#ifdef ENABLE_DEBUG
DEBUG("%d!",candidate->packets_tx[i]);
if (i < ETX_WINDOW - 1) {
DEBUG(",");
}
#endif
} else {
//Add 1 and set field
pkt_count = pkt_count + 1;
candidate->packets_tx[i] = 1;
#ifdef ENABLE_DEBUG
DEBUG("%d!",candidate->packets_tx[i]);
if (i < ETX_WINDOW - 1) {
DEBUG(",");
}
#endif
}
}
}

@ -12,17 +12,17 @@
#include "sys/net/sixlowpan/sixlowip.h"
//For debugging purposes
#define ENABLE_DEBUG
#define ENABLE_DEBUG (0)
#include <debug.h>
#ifdef ENABLE_DEBUG
#define ETX_BEACON_STACKSIZE 4500
#define ETX_RADIO_STACKSIZE 4500
#define ETX_CLOCK_STACKSIZE 500
#if ENABLE_DEBUG
#define ETX_BEACON_STACKSIZE (4500)
#define ETX_RADIO_STACKSIZE (4500)
#define ETX_CLOCK_STACKSIZE (500)
#else
#define ETX_BEACON_STACKSIZE 2500 //TODO optimize, maybe 2000 is enough
#define ETX_RADIO_STACKSIZE 2500 //TODO optimize, maybe 2000 is enough
#define ETX_CLOCK_STACKSIZE 500 //TODO optimize, maybe 250 is enough
#define ETX_BEACON_STACKSIZE (2500) //TODO optimize, maybe 2000 is enough
#define ETX_RADIO_STACKSIZE (2500) //TODO optimize, maybe 2000 is enough
#define ETX_CLOCK_STACKSIZE (500) //TODO optimize, maybe 250 is enough
#endif
//[option|length|ipaddr.|packetcount] with up to 15 ipaddr|packetcount pairs
@ -35,13 +35,13 @@
* Default 40, should be enough to get all messages for neighbors.
* In my tests, the maximum count of neighbors was around 30-something
*/
#ifdef ENABLE_DEBUG
#define ETX_MAX_CANDIDATE_NEIGHBORS 15 //Stacksizes are huge in debug mode, so memory is rare
#if ENABLE_DEBUG
#define ETX_MAX_CANDIDATE_NEIGHBORS (15) //Stacksizes are huge in debug mode, so memory is rare
#else
#define ETX_MAX_CANDIDATE_NEIGHBORS 40
#define ETX_MAX_CANDIDATE_NEIGHBORS (40)
#endif
//ETX Interval parameters
#define MS 1000
#define MS (1000)
/*
* ETX_INTERVAL

@ -1,8 +1,3 @@
//For debugging purposes
#define ENABLE_DEBUG
#include <debug.h>
#include "rpl_structs.h"
/*

@ -31,6 +31,8 @@
#include "vtimer.h"
#include "mutex.h"
#define ENABLE_DEBUG (0)
/* extern variables */
uint8_t opt_hdr_len = 0;
uint8_t ipv6_ext_hdr_len = 0;
@ -200,7 +202,7 @@ void init_rtr_sol(uint8_t sllao)
icmp_buf->checksum = 0;
icmp_buf->checksum = ~icmpv6_csum(PROTO_NUM_ICMPV6);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
printf("INFO: send router solicitation to: ");
ipv6_print_addr(&ipv6_buf->destaddr);
#endif
@ -251,7 +253,7 @@ void recv_rtr_sol(void)
init_rtr_adv(&ipv6_buf->srcaddr, 0, 0, OPT_PI, 0, 0);
}
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
printf("INFO: send router advertisment to: ");
ipv6_print_addr(&ipv6_buf->destaddr);
#endif
@ -631,7 +633,7 @@ void recv_rtr_adv(void)
*
* if new address was configured, set src to newaddr(gp16) */
init_nbr_sol(&newaddr, &(ipv6_buf->srcaddr), &(ipv6_buf->srcaddr), OPT_SLLAO, OPT_ARO);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
printf("INFO: send neighbor solicitation to: ");
ipv6_print_addr(&(ipv6_buf->destaddr));
#endif
@ -886,7 +888,7 @@ void recv_nbr_sol(void)
uint8_t flags = (NBR_ADV_FLAG_O | NBR_ADV_FLAG_S);
init_nbr_adv(&(ipv6_buf->srcaddr), &(ipv6_buf->destaddr),
&(alist_targ->addr), flags, 0, OPT_ARO, aro_state);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
printf("INFO: send neighbor advertisment to: ");
ipv6_print_addr(&ipv6_buf->destaddr);
#endif

@ -51,6 +51,7 @@
#endif
#endif
#define ENABLE_DEBUG (0)
#include <debug.h>
/*------------------------------------------------------------------------------------*/

@ -13,9 +13,9 @@
#include <vtimer.h>
#define ENABLE_DEBUG (0)
#include <debug.h>
#define VTIMER_THRESHOLD 20UL
#define VTIMER_BACKOFF 10UL
@ -28,7 +28,7 @@ static int vtimer_set(vtimer_t *timer);
static int set_longterm(vtimer_t *timer);
static int set_shortterm(vtimer_t *timer);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
void vtimer_print(vtimer_t *t);
#endif
@ -117,7 +117,7 @@ void vtimer_callback(void *ptr)
timer = (vtimer_t *)queue_remove_head(&shortterm_queue_root);
#ifdef ENABLE_DEBUG
#if ENABLE_DEBUG
vtimer_print(timer);
#endif
DEBUG("vtimer_callback(): Shooting %" PRIu32 ".\n", timer->absolute.microseconds);

Loading…
Cancel
Save