From a5d4ed2fef142d158eeec865c5513c589fa1ae78 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 8 Sep 2015 07:24:26 -0600 Subject: [PATCH] Make sure that CONFIG_USBDEV_TRACE_INITIALIDSET has an assigned value to avoid warnings --- examples/usbserial/usbserial_main.c | 6 +++++- examples/usbterm/usbterm.h | 6 +++++- examples/usbterm/usbterm_main.c | 6 +++--- system/composite/composite.h | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/usbserial/usbserial_main.c b/examples/usbserial/usbserial_main.c index 7a80d90e6..04af142de 100644 --- a/examples/usbserial/usbserial_main.c +++ b/examples/usbserial/usbserial_main.c @@ -72,6 +72,10 @@ # endif #endif +#ifndef CONFIG_USBDEV_TRACE_INITIALIDSET +# define CONFIG_USBDEV_TRACE_INITIALIDSET 0 +#endif + #ifdef CONFIG_EXAMPLES_USBSERIAL_TRACEINIT # define TRACE_INIT_BITS (TRACE_INIT_BIT) #else @@ -223,7 +227,7 @@ int usbserial_main(int argc, char *argv[]) printf("usbserial_main: Successfully registered the serial driver\n"); -#if CONFIG_USBDEV_TRACE && CONFIG_USBDEV_TRACE_INITIALIDSET != 0 +#if defined(CONFIG_USBDEV_TRACE) && CONFIG_USBDEV_TRACE_INITIALIDSET != 0 /* If USB tracing is enabled and tracing of initial USB events is specified, * then dump all collected trace data to stdout */ diff --git a/examples/usbterm/usbterm.h b/examples/usbterm/usbterm.h index 303d1b9f1..755c28046 100644 --- a/examples/usbterm/usbterm.h +++ b/examples/usbterm/usbterm.h @@ -47,7 +47,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ @@ -55,6 +55,10 @@ # define CONFIG_EXAMPLES_USBTERM_BUFLEN 256 #endif +#ifndef CONFIG_USBDEV_TRACE_INITIALIDSET +# define CONFIG_USBDEV_TRACE_INITIALIDSET 0 +#endif + #ifdef CONFIG_EXAMPLES_USBTERM_TRACEINIT # define TRACE_INIT_BITS (TRACE_INIT_BIT) #else diff --git a/examples/usbterm/usbterm_main.c b/examples/usbterm/usbterm_main.c index 3ec2a4a2b..ed1c56833 100644 --- a/examples/usbterm/usbterm_main.c +++ b/examples/usbterm/usbterm_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/usbterm/usbterm_main.c * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ #include "usbterm.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -226,7 +226,7 @@ int usbterm_main(int argc, char *argv[]) } printf("usbterm_main: Successfully registered the serial driver\n"); -#if CONFIG_USBDEV_TRACE && CONFIG_USBDEV_TRACE_INITIALIDSET != 0 +#if defined(CONFIG_USBDEV_TRACE) && CONFIG_USBDEV_TRACE_INITIALIDSET != 0 /* If USB tracing is enabled and tracing of initial USB events is specified, * then dump all collected trace data to stdout */ diff --git a/system/composite/composite.h b/system/composite/composite.h index 1f4274f62..d64228dd2 100644 --- a/system/composite/composite.h +++ b/system/composite/composite.h @@ -129,6 +129,10 @@ /* Trace initialization *****************************************************/ +#ifndef CONFIG_USBDEV_TRACE_INITIALIDSET +# define CONFIG_USBDEV_TRACE_INITIALIDSET 0 +#endif + #ifdef CONFIG_SYSTEM_COMPOSITE_TRACEINIT # define TRACE_INIT_BITS (TRACE_INIT_BIT) #else