diff options
Diffstat (limited to 'nuttx/arch/mips/src/mips32/up_assert.c')
-rw-r--r-- | nuttx/arch/mips/src/mips32/up_assert.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nuttx/arch/mips/src/mips32/up_assert.c b/nuttx/arch/mips/src/mips32/up_assert.c index bd59bbc2c..767393667 100644 --- a/nuttx/arch/mips/src/mips32/up_assert.c +++ b/nuttx/arch/mips/src/mips32/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/mips32/up_assert.c * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,8 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> +#include <nuttx/usb/usbdev_trace.h> + #include <arch/board/board.h> #include "up_arch.h" @@ -55,6 +57,11 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* USB trace dumping */ + +#ifndef CONFIG_USBDEV_TRACE +# undef CONFIG_ARCH_USBDUMP +#endif /* Output debug info if stack dump is selected -- even if debug is not * selected. @@ -115,6 +122,18 @@ static void _up_assert(int errorcode) } /**************************************************************************** + * Name: assert_tracecallback + ****************************************************************************/ + +#ifdef CONFIG_ARCH_USBDUMP +static int assert_tracecallback(struct usbtrace_s *trace, void *arg) +{ + usbtrace_trprintf((trprintf_t)lowsyslog, trace->event, trace->value); + return 0; +} +#endif + +/**************************************************************************** * Public Functions ****************************************************************************/ @@ -139,5 +158,12 @@ void up_assert(const uint8_t *filename, int lineno) #endif up_dumpstate(); + +#ifdef CONFIG_ARCH_USBDUMP + /* Dump USB trace data */ + + (void)usbtrace_enumerate(assert_tracecallback, NULL); +#endif + _up_assert(EXIT_FAILURE); } |