From 49917a57970439cb2eedd5442661aab876e12d6d Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Sat, 12 Sep 2015 12:43:15 +0200 Subject: [PATCH] core: cpu: fix check for DEVELHELP --- core/include/debug.h | 2 +- core/lifo.c | 4 ++-- core/msg.c | 4 ++-- core/panic.c | 4 ++-- cpu/arm7_common/panic.c | 2 +- cpu/cortexm_common/panic.c | 2 +- cpu/lpc2387/periph/gpio.c | 2 +- cpu/msp430-common/panic.c | 2 +- cpu/native/irq_cpu.c | 2 +- cpu/native/panic.c | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/include/debug.h b/core/include/debug.h index fab626f4e..30caf45ee 100644 --- a/core/include/debug.h +++ b/core/include/debug.h @@ -54,7 +54,7 @@ extern "C" { * information to stdout after verifying the stack is big enough. If `DEVELHELP` * is not set, this check is not performed. (CPU exception may occur) */ -#if DEVELHELP +#ifdef DEVELHELP #include "cpu_conf.h" #define DEBUG_PRINT(...) \ do { \ diff --git a/core/lifo.c b/core/lifo.c index 2dd6b8826..025a1a698 100644 --- a/core/lifo.c +++ b/core/lifo.c @@ -41,7 +41,7 @@ void lifo_insert(int *array, int i) int index = i + 1; -#if DEVELHELP +#ifdef DEVELHELP if ((array[index] != -1) && (array[0] != -1)) { LOG_WARNING("lifo_insert: overwriting array[%i] == %i with %i\n\n\n\t\tThe lifo is broken now.\n\n\n", index, array[index], array[0]); } @@ -60,7 +60,7 @@ int lifo_get(int *array) array[0] = array[head + 1]; } -#if DEVELHELP +#ifdef DEVELHELP /* make sure a double insert does not result in an infinite * resource of values */ array[head+1] = -1; diff --git a/core/msg.c b/core/msg.c index 850fad03b..123ba95cb 100644 --- a/core/msg.c +++ b/core/msg.c @@ -77,7 +77,7 @@ int msg_try_send(msg_t *m, kernel_pid_t target_pid) static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned state) { -#if DEVELHELP +#ifdef DEVELHELP if (!pid_is_valid(target_pid)) { DEBUG("msg_send(): target_pid is invalid, continuing anyways\n"); } @@ -179,7 +179,7 @@ int msg_send_to_self(msg_t *m) int msg_send_int(msg_t *m, kernel_pid_t target_pid) { -#if DEVELHELP +#ifdef DEVELHELP if (!pid_is_valid(target_pid)) { DEBUG("msg_send(): target_pid is invalid, continuing anyways\n"); } diff --git a/core/panic.c b/core/panic.c index 2df142e6d..b00e0052c 100644 --- a/core/panic.c +++ b/core/panic.c @@ -31,7 +31,7 @@ #include "panic.h" #include "arch/panic_arch.h" -#if DEVELHELP && defined MODULE_PS +#if defined(DEVELHELP) && defined(MODULE_PS) #include "ps.h" #endif @@ -55,7 +55,7 @@ NORETURN void core_panic(core_panic_t crash_code, const char *message) cpu_print_last_instruction(); } #endif -#if DEVELHELP +#ifdef DEVELHELP #ifdef MODULE_PS ps(); puts(""); diff --git a/cpu/arm7_common/panic.c b/cpu/arm7_common/panic.c index 93da793df..99ffc4c01 100644 --- a/cpu/arm7_common/panic.c +++ b/cpu/arm7_common/panic.c @@ -21,7 +21,7 @@ void panic_arch(void) { -#if DEVELHELP +#ifdef DEVELHELP /* enter infinite loop, into deepest possible sleep mode */ while (1) { lpm_set(LPM_OFF); diff --git a/cpu/cortexm_common/panic.c b/cpu/cortexm_common/panic.c index ade9a5781..81fec8260 100644 --- a/cpu/cortexm_common/panic.c +++ b/cpu/cortexm_common/panic.c @@ -23,7 +23,7 @@ void panic_arch(void) { -#if DEVELHELP +#ifdef DEVELHELP /* The bkpt instruction will signal to the debugger to break here. */ __ASM("bkpt #0"); /* enter infinite loop, into deepest possible sleep mode */ diff --git a/cpu/lpc2387/periph/gpio.c b/cpu/lpc2387/periph/gpio.c index b46b4f8d3..6576fae7c 100644 --- a/cpu/lpc2387/periph/gpio.c +++ b/cpu/lpc2387/periph/gpio.c @@ -116,7 +116,7 @@ int gpio_init_int(gpio_t pin, gpio_pp_t pullup, gpio_flank_t flank, } if (_state_index == 0xff) { -#if DEVELHELP +#ifdef DEVELHELP puts("lpc2387: gpio: warning: no free gpio callback state!"); #endif return -1; diff --git a/cpu/msp430-common/panic.c b/cpu/msp430-common/panic.c index 133347289..7c7953329 100644 --- a/cpu/msp430-common/panic.c +++ b/cpu/msp430-common/panic.c @@ -24,7 +24,7 @@ void panic_arch(void) { /* disable watchdog and all possible sources of interrupts */ WDTCTL = WDTPW | WDTHOLD; -#if DEVELHELP +#ifdef DEVELHELP /* enter infinite loop, into deepest possible sleep mode */ while (1) { lpm_set(LPM_OFF); diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c index 1a8ea8ca9..16fcbcbce 100644 --- a/cpu/native/irq_cpu.c +++ b/cpu/native/irq_cpu.c @@ -170,7 +170,7 @@ unsigned enableIRQ(void) unsigned int prev_state; if (_native_in_isr == 1) { -#if DEVELHELP +#ifdef DEVELHELP real_write(STDERR_FILENO, "enableIRQ + _native_in_isr\n", 27); #else DEBUG("enableIRQ + _native_in_isr\n"); diff --git a/cpu/native/panic.c b/cpu/native/panic.c index 357106691..42945cba2 100644 --- a/cpu/native/panic.c +++ b/cpu/native/panic.c @@ -25,7 +25,7 @@ void panic_arch(void) { -#if DEVELHELP +#ifdef DEVELHELP /* since we're atop an Unix-like platform, just use the (developer-)friendly core-dump feature */ kill(_native_pid, SIGTRAP);