summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-07-23 13:05:45 -0700
committerChromeBot <chrome-bot@google.com>2013-07-23 17:37:53 -0700
commitcb1f7306b34507b3d9481cd4327271b2227747b8 (patch)
treea6862df1fbcfa4432743de4cd9ae0f1b64e3c344
parenta1699727a83758defb2e80deab59d34a18bfe581 (diff)
downloadchrome-ec-cb1f7306b34507b3d9481cd4327271b2227747b8.tar.gz
Clean up debug config options
All of these were defined on all but a few platforms, and those explicitly #undef them. So define them as enabled by default in config.h so the board.h files are cleaner. No functional changes; just rearranging/renaming config constants. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; FEATURES=test emerge-falco chromeos-ec Change-Id: I1201a1472ae29641e9e219c2a0347691ca64cd28 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63102 Reviewed-by: Vic Yang <victoryang@chromium.org>
-rw-r--r--README21
-rw-r--r--board/bds/board.h5
-rw-r--r--board/daisy/board.h4
-rw-r--r--board/falco/board.h6
-rw-r--r--board/host/board.h4
-rw-r--r--board/link/board.h6
-rw-r--r--board/mccroskey/board.h5
-rw-r--r--board/peppy/board.h6
-rw-r--r--board/pit/board.h4
-rw-r--r--board/puppy/board.h4
-rw-r--r--board/slippy/board.h6
-rw-r--r--board/snow/board.h3
-rw-r--r--board/spring/board.h3
-rw-r--r--board/wolf/board.h6
-rw-r--r--chip/lm4/config_chip.h3
-rw-r--r--chip/stm32/config_chip.h3
-rw-r--r--chip/stm32/gpio-stm32f.c2
-rw-r--r--chip/stm32/gpio-stm32l.c2
-rw-r--r--chip/stm32/i2c-stm32f.c6
-rw-r--r--chip/stm32/i2c-stm32l.c4
-rw-r--r--core/cortex-m/panic.c10
-rw-r--r--core/cortex-m/task.c4
-rw-r--r--include/config.h97
-rw-r--r--include/util.h16
24 files changed, 109 insertions, 121 deletions
diff --git a/README b/README
index 4190514c93..8239b4c022 100644
--- a/README
+++ b/README
@@ -37,27 +37,6 @@ below will be moved there over time.
This is needed on STM32, where the independent watchdog has no early
warning feature and the windowed watchdog has a very short period.
-- CONFIG_PANIC_HELP
-
- Report extra information about a panic, such as the fault address,
- here shown as bfar. This shows the reason for the fault and may help
- to determine the cause.
-
- === EXCEPTION: 03 ====== xPSR: 01000000 ===========
- r0 :0000000b r1 :00000047 r2 :60000000 r3 :200013dd
- r4 :00000000 r5 :080053f4 r6 :200013d0 r7 :00000002
- r8 :00000000 r9 :200013de r10:00000000 r11:00000000
- r12:00000000 sp :200009a0 lr :08002b85 pc :08003a8a
- Precise data bus error, Forced hard fault, Vector catch, bfar = 60000000
- mmfs = 00008200, shcsr = 00000000, hfsr = 40000000, dfsr = 00000008
-
-- CONFIG_ASSERT_HELP
-
- Report assertion failures in a vebose manner to aid debugging. When
- enabled an ASSERT() which fails will produce message in the form:
-
- ASSERTION FAILURE '<expr>' in function() at file:line
-
- CONFIG_AC_POWER_STATUS
Monitor the state of the AC power input and drive out a GPIO to
diff --git a/board/bds/board.h b/board/bds/board.h
index 00127fd8c0..98b0945515 100644
--- a/board/bds/board.h
+++ b/board/bds/board.h
@@ -8,12 +8,7 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_PANIC_HELP
-#define CONFIG_ASSERT_HELP
-
/* Optional features */
-#define CONFIG_CONSOLE_CMDHELP
#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands */
/* LM4 modules we don't use on link but still want to keep compiling */
diff --git a/board/daisy/board.h b/board/daisy/board.h
index 2c8d0db1e3..681d09a345 100644
--- a/board/daisy/board.h
+++ b/board/daisy/board.h
@@ -14,10 +14,6 @@
/* Use USART1 as console serial port */
#define CONFIG_CONSOLE_UART 1
-/* Debug features */
-#define CONFIG_PANIC_HELP
-#define CONFIG_ASSERT_HELP
-
/* Optional features */
#define CONFIG_BATTERY_SMART
#define CONFIG_BOARD_POST_GPIO_INIT
diff --git a/board/falco/board.h b/board/falco/board.h
index 37a923e43e..d3c5dfd215 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -8,12 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
-
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_FALCO
diff --git a/board/host/board.h b/board/host/board.h
index 7ef70bd3a7..e9d0e3adbe 100644
--- a/board/host/board.h
+++ b/board/host/board.h
@@ -8,10 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Assertion support */
-#define CONFIG_DEBUG
-#define CONFIG_ASSERT_HELP
-
/* Optional features */
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_HOSTCMD
diff --git a/board/link/board.h b/board/link/board.h
index 485979153f..a84bf1f8a1 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -8,12 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
-
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_LINK
diff --git a/board/mccroskey/board.h b/board/mccroskey/board.h
index 6001df7f31..99cfaf6509 100644
--- a/board/mccroskey/board.h
+++ b/board/mccroskey/board.h
@@ -15,10 +15,7 @@
#define CONFIG_CONSOLE_UART 1
/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_DEBUG_I2C /* FIXME(dhendrix): remove this eventually */
-#define CONFIG_PANIC_HELP
+#define CONFIG_I2C_DEBUG /* FIXME(dhendrix): remove this eventually */
#undef CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
diff --git a/board/peppy/board.h b/board/peppy/board.h
index b47ba2a7ef..3bdd58bd00 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -8,12 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
-
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_CHECK_CONNECTED
diff --git a/board/pit/board.h b/board/pit/board.h
index 7ef77aa2e2..7b1cd08eda 100644
--- a/board/pit/board.h
+++ b/board/pit/board.h
@@ -12,10 +12,6 @@
#define CONFIG_CONSOLE_UART 1
/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
/* Optional features */
diff --git a/board/puppy/board.h b/board/puppy/board.h
index f4f3b9a90d..1618ce7158 100644
--- a/board/puppy/board.h
+++ b/board/puppy/board.h
@@ -12,10 +12,6 @@
#define CONFIG_CONSOLE_UART 1
/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
/* Optional features */
diff --git a/board/slippy/board.h b/board/slippy/board.h
index febea388a7..0211f06b1b 100644
--- a/board/slippy/board.h
+++ b/board/slippy/board.h
@@ -8,12 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
-
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_CHECK_CONNECTED
diff --git a/board/snow/board.h b/board/snow/board.h
index add3a9a8ef..73b67e3610 100644
--- a/board/snow/board.h
+++ b/board/snow/board.h
@@ -15,9 +15,6 @@
#define CONFIG_CONSOLE_UART 1
/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
#undef CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
diff --git a/board/spring/board.h b/board/spring/board.h
index eda82603c8..f919c99987 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -16,9 +16,6 @@
#define CONFIG_CONSOLE_RESTRICTED_INPUT
/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
#undef CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
diff --git a/board/wolf/board.h b/board/wolf/board.h
index 8386d425b4..90e8f57612 100644
--- a/board/wolf/board.h
+++ b/board/wolf/board.h
@@ -8,12 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Debug features */
-#define CONFIG_ASSERT_HELP
-#define CONFIG_CONSOLE_CMDHELP
-#define CONFIG_PANIC_HELP
-#define CONFIG_TASK_PROFILING
-
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#ifdef HAS_TASK_CHIPSET
diff --git a/chip/lm4/config_chip.h b/chip/lm4/config_chip.h
index 8d1077f12c..c1a60e7013 100644
--- a/chip/lm4/config_chip.h
+++ b/chip/lm4/config_chip.h
@@ -98,9 +98,6 @@
/****************************************************************************/
/* Customize the build */
-/* Build with assertions and debug messages */
-#define CONFIG_DEBUG
-
/* Optional features present on this chip */
#define CONFIG_ADC
#define CONFIG_FLASH
diff --git a/chip/stm32/config_chip.h b/chip/stm32/config_chip.h
index e6df7a7730..009c4971e4 100644
--- a/chip/stm32/config_chip.h
+++ b/chip/stm32/config_chip.h
@@ -41,9 +41,6 @@
#define CONFIG_FLASH
#define CONFIG_FMAP
-/* build with assertions and debug messages */
-#define CONFIG_DEBUG
-
/* Enable watchdog timer */
#define CONFIG_WATCHDOG
diff --git a/chip/stm32/gpio-stm32f.c b/chip/stm32/gpio-stm32f.c
index fdc2ff2549..df892705d0 100644
--- a/chip/stm32/gpio-stm32f.c
+++ b/chip/stm32/gpio-stm32f.c
@@ -193,12 +193,10 @@ int gpio_enable_interrupt(enum gpio_signal signal)
bit = 31 - __builtin_clz(g->mask);
-#ifdef CONFIG_DEBUG
if (exti_events[bit]) {
CPRINTF("Overriding %s with %s on EXTI%d\n",
exti_events[bit]->name, g->name, bit);
}
-#endif
exti_events[bit] = g;
group = bit / 4;
diff --git a/chip/stm32/gpio-stm32l.c b/chip/stm32/gpio-stm32l.c
index 8f7a0fc5f0..5587625081 100644
--- a/chip/stm32/gpio-stm32l.c
+++ b/chip/stm32/gpio-stm32l.c
@@ -201,12 +201,10 @@ int gpio_enable_interrupt(enum gpio_signal signal)
bit = 31 - __builtin_clz(g->mask);
-#ifdef CONFIG_DEBUG
if (exti_events[bit]) {
CPRINTF("Overriding %s with %s on EXTI%d\n",
exti_events[bit]->name, g->name, bit);
}
-#endif
exti_events[bit] = g;
group = bit / 4;
diff --git a/chip/stm32/i2c-stm32f.c b/chip/stm32/i2c-stm32f.c
index 4fbacc1713..36cbd857df 100644
--- a/chip/stm32/i2c-stm32f.c
+++ b/chip/stm32/i2c-stm32f.c
@@ -517,7 +517,7 @@ DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
static inline void dump_i2c_reg(int port)
{
-#ifdef CONFIG_DEBUG_I2C
+#ifdef CONFIG_I2C_DEBUG
CPRINTF("CR1 : %016b\n", STM32_I2C_CR1(port));
CPRINTF("CR2 : %016b\n", STM32_I2C_CR2(port));
CPRINTF("SR2 : %016b\n", STM32_I2C_SR2(port));
@@ -527,7 +527,7 @@ static inline void dump_i2c_reg(int port)
CPRINTF("DR : %016b\n", STM32_I2C_DR(port));
CPRINTF("CCR : %016b\n", STM32_I2C_CCR(port));
CPRINTF("TRISE: %016b\n", STM32_I2C_TRISE(port));
-#endif /* CONFIG_DEBUG_I2C */
+#endif /* CONFIG_I2C_DEBUG */
}
enum wait_t {
@@ -660,7 +660,7 @@ static void handle_i2c_error(int port, int rv)
/* EC_ERROR_TIMEOUT may have a code specifying where the timeout was */
if ((rv & 0xff) == EC_ERROR_TIMEOUT) {
-#ifdef CONFIG_DEBUG_I2C
+#ifdef CONFIG_I2C_DEBUG
CPRINTF("Wait_status() timeout type: %d\n", (rv >> 8));
#endif
rv = EC_ERROR_TIMEOUT;
diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c
index 36f6817815..0f258c1ce6 100644
--- a/chip/stm32/i2c-stm32l.c
+++ b/chip/stm32/i2c-stm32l.c
@@ -18,8 +18,6 @@
#include "timer.h"
#include "util.h"
-/* #define CONFIG_DEBUG_I2C */
-
extern const struct i2c_port_t i2c_ports[I2C_PORTS_USED];
/* Console output macros */
@@ -42,7 +40,7 @@ extern const struct i2c_port_t i2c_ports[I2C_PORTS_USED];
*/
#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
-#ifdef CONFIG_DEBUG_I2C
+#ifdef CONFIG_I2C_DEBUG
static void dump_i2c_reg(int port, const char *what)
{
CPRINTF("[%T i2c CR1=%04x CR2=%04x SR1=%04x SR2=%04x %s]\n",
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c
index 85d0701b21..9e82f241d0 100644
--- a/core/cortex-m/panic.c
+++ b/core/cortex-m/panic.c
@@ -130,7 +130,7 @@ static int32_t is_frame_in_handler_stack(const uint32_t exc_return)
return (exc_return & 0xf) == 1 || (exc_return & 0xf) == 9;
}
-#ifdef CONFIG_PANIC_HELP
+#ifdef CONFIG_DEBUG_EXCEPTIONS
/* Names for each of the bits in the mmfs register, starting at bit 0 */
static const char * const mmfs_name[32] = {
"Instruction access violation",
@@ -322,7 +322,7 @@ static void panic_show_process_stack(const struct panic_data *pdata)
panic_printf("\nBad psp");
}
}
-#endif /* CONFIG_PANIC_HELP */
+#endif /* CONFIG_DEBUG_EXCEPTIONS */
/**
* Display a message and reboot
@@ -360,7 +360,7 @@ static void panic_print(const struct panic_data *pdata)
print_reg(14, sregs, 5);
print_reg(15, sregs, 6);
-#ifdef CONFIG_PANIC_HELP
+#ifdef CONFIG_DEBUG_EXCEPTIONS
panic_show_extra(pdata);
#endif
}
@@ -400,7 +400,7 @@ void report_panic(void)
pdata->dfsr = CPU_NVIC_DFSR;
panic_print(pdata);
-#ifdef CONFIG_PANIC_HELP
+#ifdef CONFIG_DEBUG_EXCEPTIONS
panic_show_process_stack(pdata);
/* TODO: Dump main stack contents as well if the exception happened
* in a handler's context. */
@@ -442,7 +442,7 @@ void ignore_bus_fault(int ignored)
bus_fault_ignored = ignored;
}
-#ifdef CONFIG_ASSERT_HELP
+#ifdef CONFIG_DEBUG_ASSERT_REBOOTS
void panic_assert_fail(const char *msg, const char *func, const char *fname,
int linenum)
{
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index bd5736a3ae..75ed85204b 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -515,8 +515,6 @@ void task_print_list(void)
}
}
-#ifdef CONFIG_DEBUG
-
int command_task_info(int argc, char **argv)
{
#ifdef CONFIG_TASK_PROFILING
@@ -568,8 +566,6 @@ DECLARE_CONSOLE_COMMAND(taskready, command_task_ready,
"Print/set ready tasks",
NULL);
-#endif /* CONFIG_DEBUG */
-
void task_pre_init(void)
{
uint32_t *stack_next = (uint32_t *)task_stacks;
diff --git a/include/config.h b/include/config.h
index d86c6381d2..0f8ca564b6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -27,13 +27,16 @@
* To get a list current list, run this command:
* git grep " CONFIG_" | grep -o "CONFIG_[A-Za-z0-9_]\+" | sort | uniq
*
+ * Some options are #defined here to enable them by default. Chips or boards
+ * may override this by #undef'ing them in config_chip.h or board.h,
+ * respectively.
+ *
* TODO(rspangler): describe all of these. Also describe the HAS_TASK_* macro
* and how/when it should be used vs. a config define.
*/
#undef CONFIG_AC_POWER_STATUS
#undef CONFIG_ADC
-#undef CONFIG_ASSERT_HELP
#undef CONFIG_BACKLIGHT_X86
/*****************************************************************************/
@@ -115,13 +118,76 @@
#undef CONFIG_CMD_SCRATCHPAD
#undef CONFIG_CMD_SLEEP
-#undef CONFIG_CONSOLE_CMDHELP
+/*****************************************************************************/
+
+/*
+ * Provide additional help on console commands, such as the supported
+ * options/usage.
+ *
+ * Boards may #undef this to reduce image size.
+ */
+#define CONFIG_CONSOLE_CMDHELP
+
#undef CONFIG_CONSOLE_RESTRICTED_INPUT
#undef CONFIG_CONSOLE_UART
#undef CONFIG_CUSTOM_KEYSCAN
-#undef CONFIG_DEBUG
-#undef CONFIG_DEBUG_I2C
+
+/*****************************************************************************/
+/*
+ * Debugging config
+ *
+ * Note that these options are enabled by default, because they're really
+ * handy for debugging systems during bringup and even at factory time.
+ *
+ * A board may undefine any or all of these to reduce image size and RAM usage,
+ * at the cost of debuggability.
+ */
+
+/*
+ * ASSERT() macros are checked at runtime. See CONFIG_DEBUG_ASSERT_REBOOTS
+ * to see what happens if one fails.
+ *
+ * Boards may #undef this to reduce image size.
+ */
+#define CONFIG_DEBUG_ASSERT
+
+/*
+ * Prints a message and reboots if an ASSERT() macro fails at runtime. When
+ * enabled, an ASSERT() which fails will produce a message of the form:
+ *
+ * ASSERTION FAILURE '<expr>' in function() at file:line
+ *
+ * If this is not defined, failing ASSERT() will trigger a BKPT instruction
+ * instead.
+ *
+ * Ignored if CONFIG_DEBUG_ASSERT is not defined.
+ *
+ * Boards may #undef this to reduce image size.
+ */
+#define CONFIG_DEBUG_ASSERT_REBOOTS
+
+/*
+ * Print additional information when exceptions are triggered, such as the
+ * fault address, here shown as bfar. This shows the reason for the fault
+ * and may help to determine the cause.
+ *
+ * === EXCEPTION: 03 ====== xPSR: 01000000 ===========
+ * r0 :0000000b r1 :00000047 r2 :60000000 r3 :200013dd
+ * r4 :00000000 r5 :080053f4 r6 :200013d0 r7 :00000002
+ * r8 :00000000 r9 :200013de r10:00000000 r11:00000000
+ * r12:00000000 sp :200009a0 lr :08002b85 pc :08003a8a
+ * Precise data bus error, Forced hard fault, Vector catch, bfar = 60000000
+ * mmfs = 00008200, shcsr = 00000000, hfsr = 40000000, dfsr = 00000008
+ *
+ * If this is not defined, only a register dump will be printed.
+ *
+ * Boards may #undef this to reduce image size.
+ */
+#define CONFIG_DEBUG_EXCEPTIONS
+
+/*****************************************************************************/
+
#undef CONFIG_DMA_HELP
#undef CONFIG_EEPROM
#undef CONFIG_EOPTION
@@ -167,6 +233,7 @@
#undef CONFIG_I2C
#undef CONFIG_I2C_ARBITRATION
+#undef CONFIG_I2C_DEBUG
#undef CONFIG_I2C_DEBUG_PASSTHRU
#undef CONFIG_I2C_HOST_AUTO
#undef CONFIG_I2C_PASSTHROUGH
@@ -190,7 +257,6 @@
#undef CONFIG_ONEWIRE
#undef CONFIG_ONEWIRE_LED
#undef CONFIG_OVERFLOW_DETECT
-#undef CONFIG_PANIC_HELP
#undef CONFIG_PECI
/*****************************************************************************/
@@ -231,8 +297,27 @@
#undef CONFIG_STACK_SIZE
#undef CONFIG_SWITCH
#undef CONFIG_SYSTEM_UNLOCKED
+
+/*
+ * List of enabled tasks in ascending priority order. This is normally
+ * defined in each board's ec.tasklist file.
+ *
+ * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and
+ * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries,
+ * where :
+ * 'n' is the name of the task
+ * 'r' is the main routine of the task
+ * 'd' is an opaque parameter passed to the routine at startup
+ * 's' is the stack size in bytes; must be a multiple of 8
+ */
#undef CONFIG_TASK_LIST
-#undef CONFIG_TASK_PROFILING
+
+/*
+ * Enable task profiling.
+ *
+ * Boards may #undef this to reduce image size and RAM usage.
+ */
+#define CONFIG_TASK_PROFILING
#undef CONFIG_TEMP_SENSOR
#undef CONFIG_TEMP_SENSOR_G781
diff --git a/include/util.h b/include/util.h
index dc9cffdee0..ed30ed4e46 100644
--- a/include/util.h
+++ b/include/util.h
@@ -16,19 +16,19 @@
* Trigger a debug exception if the condition
* is not verified at runtime.
*/
-#ifdef CONFIG_DEBUG
-# ifdef CONFIG_ASSERT_HELP
-# define ASSERT(cond) do { \
+#ifdef CONFIG_DEBUG_ASSERT
+#ifdef CONFIG_DEBUG_ASSERT_REBOOTS
+#define ASSERT(cond) do { \
if (!(cond)) \
panic_assert_fail(#cond, __func__, __FILE__, \
__LINE__); \
- } while (0);
-# else
-# define ASSERT(cond) do { \
+ } while (0)
+#else
+#define ASSERT(cond) do { \
if (!(cond)) \
__asm("bkpt"); \
- } while (0);
-# endif
+ } while (0)
+#endif
#else
#define ASSERT(cond)
#endif