diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-26 22:03:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-26 22:03:57 +0000 |
commit | 81b06c3326d2e54ee9f0e88213d431e2c1e9453e (patch) | |
tree | 056e422668e4904ba2f529561468e7f170ee1678 /nuttx | |
parent | 09f930863d82ecda840f36b7d782e0bc6ae8cbce (diff) | |
download | px4-nuttx-81b06c3326d2e54ee9f0e88213d431e2c1e9453e.tar.gz px4-nuttx-81b06c3326d2e54ee9f0e88213d431e2c1e9453e.tar.bz2 px4-nuttx-81b06c3326d2e54ee9f0e88213d431e2c1e9453e.zip |
Fixed a compilation problem that occurs with certain combinations of options
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2703 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/arch/arm/src/arm/up_assert.c | 22 | ||||
-rw-r--r-- | nuttx/arch/arm/src/cortexm3/up_assert.c | 23 |
2 files changed, 36 insertions, 9 deletions
diff --git a/nuttx/arch/arm/src/arm/up_assert.c b/nuttx/arch/arm/src/arm/up_assert.c index cd0b59511..f52dc1b94 100644 --- a/nuttx/arch/arm/src/arm/up_assert.c +++ b/nuttx/arch/arm/src/arm/up_assert.c @@ -65,6 +65,19 @@ # define lldbg lib_lowprintf #endif +/* The following is just intended to keep some ugliness out of the mainline + * code. We are going to print the task name if: + * + * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name + * (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used) + * defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used + */ + +#undef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP)) +# define CONFIG_PRINT_TASKNAME 1 +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -272,12 +285,12 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) +#ifdef CONFIG_PRINT_TASKNAME _TCB *rtcb = (_TCB*)g_readytorun.head; #endif up_ledon(LED_ASSERTION); -#if CONFIG_TASK_NAME_SIZE > 0 +#ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else @@ -294,12 +307,13 @@ void up_assert(const uint8_t *filename, int lineno) void up_assert_code(const uint8_t *filename, int lineno, int errorcode) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) +#ifdef CONFIG_PRINT_TASKNAME _TCB *rtcb = (_TCB*)g_readytorun.head; #endif up_ledon(LED_ASSERTION); -#if CONFIG_TASK_NAME_SIZE > 0 + +#ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", filename, lineno, rtcb->name, errorcode); #else diff --git a/nuttx/arch/arm/src/cortexm3/up_assert.c b/nuttx/arch/arm/src/cortexm3/up_assert.c index b10bc0d8d..a2ee022b2 100644 --- a/nuttx/arch/arm/src/cortexm3/up_assert.c +++ b/nuttx/arch/arm/src/cortexm3/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/cortexm3/up_assert.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,19 @@ # define lldbg lib_lowprintf #endif +/* The following is just intended to keep some ugliness out of the mainline + * code. We are going to print the task name if: + * + * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name + * (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used) + * defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used + */ + +#undef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP)) +# define CONFIG_PRINT_TASKNAME 1 +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -273,12 +286,12 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) +#ifdef CONFIG_PRINT_TASKNAME _TCB *rtcb = (_TCB*)g_readytorun.head; #endif up_ledon(LED_ASSERTION); -#if CONFIG_TASK_NAME_SIZE > 0 +#ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else @@ -295,12 +308,12 @@ void up_assert(const uint8_t *filename, int lineno) void up_assert_code(const uint8_t *filename, int lineno, int errorcode) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) +#ifdef CONFIG_PRINT_TASKNAME _TCB *rtcb = (_TCB*)g_readytorun.head; #endif up_ledon(LED_ASSERTION); -#if CONFIG_TASK_NAME_SIZE > 0 +#ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", filename, lineno, rtcb->name, errorcode); #else |