diff options
-rw-r--r-- | nuttx/ChangeLog | 3 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 3 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_assert.c | 16 | ||||
-rw-r--r-- | nuttx/include/assert.h | 8 | ||||
-rw-r--r-- | nuttx/include/nuttx/compiler.h | 10 |
5 files changed, 27 insertions, 13 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c02857e72..3443e8a7f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -171,5 +171,8 @@ source files. * tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and so should now build in non-GNU, non-GLIBC environments. + * include/nuttx/compiler.h: Fix for using SDCC with the Z80. + * include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support + __FILE__and __LINE__ (not tested) * Started m68322 diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 1adab64be..c88c34154 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -605,6 +605,9 @@ Other memory: source files. * tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and so should now build in non-GNU, non-GLIBC environments. + * include/nuttx/compiler.h: Fix for using SDCC with the Z80. + * include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support + __FILE__and __LINE__ (not tested) * Started m68322 </pre></ul> diff --git a/nuttx/arch/pjrc-8051/src/up_assert.c b/nuttx/arch/pjrc-8051/src/up_assert.c index 01bec26ca..a0d04c393 100644 --- a/nuttx/arch/pjrc-8051/src/up_assert.c +++ b/nuttx/arch/pjrc-8051/src/up_assert.c @@ -95,7 +95,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ * Name: up_assert ************************************************************/ -void up_assert(void) +void up_assert(const ubyte *filename, int lineno) { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -104,9 +104,11 @@ void up_assert(void) up_ledon(LED_ASSERTION); #if CONFIG_TASK_NAME_SIZE > 0 - lldbg("%s: Assertion failed\n", rtcb->name); + lldbg("Assertion failed at file:%s line: %d task: %s\n", + filename, lineno, rtcb->name); #else - lldbg("Assertion failed\n"); + lldbg("Assertion failed at file:%s line: %d\n", + filename, lineno); #endif up_dumpstack(); @@ -117,7 +119,7 @@ void up_assert(void) * Name: up_assert_code ************************************************************/ -void up_assert_code(int errorcode) +void up_assert_code(const ubyte *filename, int lineno, int errorcode) { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -126,9 +128,11 @@ void up_assert_code(int errorcode) up_ledon(LED_ASSERTION); #if CONFIG_TASK_NAME_SIZE > 0 - lldbg("%s: Assertion failed, error=%d\n", rtcb->name, errorcode); + lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", + filename, lineno, rtcb->name, errorcode); #else - lldbg("Assertion failed , error=%d\n", errorcode); + lldbg("Assertion failed at file:%s line: %d error code: %d\n", + filename, lineno, errorcode); #endif up_dumpstack(); diff --git a/nuttx/include/assert.h b/nuttx/include/assert.h index 4222aa2d8..5f69b7178 100644 --- a/nuttx/include/assert.h +++ b/nuttx/include/assert.h @@ -53,7 +53,7 @@ #undef ASSERTCODE #undef DEBUGASSERT -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(SDCC) # define ASSERT(f) \ { if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); } @@ -105,9 +105,9 @@ extern "C" { #define EXTERN extern #endif -#ifdef __GNUC__ -EXTERN void up_assert(FAR const ubyte *filename, int linenum); -EXTERN void up_assert_code(FAR const ubyte *filename, int linenum, +#if defined(__GNUC__) || defined(SDCC) +EXTERN void up_assert(const ubyte *filename, int linenum); +EXTERN void up_assert_code(const ubyte *filename, int linenum, int error_code); #else EXTERN void up_assert(void); diff --git a/nuttx/include/nuttx/compiler.h b/nuttx/include/nuttx/compiler.h index b0ea16f38..2b7a96788 100644 --- a/nuttx/include/nuttx/compiler.h +++ b/nuttx/include/nuttx/compiler.h @@ -84,7 +84,7 @@ # undef CONFIG_LONG_IS_NOT_INT -/* The pointers and int are the same size */ +/* Pointers and int are the same size */ # undef CONFIG_PTR_IS_NOT_INT @@ -152,9 +152,13 @@ # define CONFIG_LONG_IS_NOT_INT 1 -/* The generic point and int are not the same size */ - +/* The generic pointer and int are not the same size + * (for some SDCC architectures) + */ + +#if !defined(__z80) && defined(__gbz80) # define CONFIG_PTR_IS_NOT_INT 1 +#endif /* SDCC does not support inline functions */ |