From a5514be85cbe4b4c753f41739426c6842794937f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 10 Aug 2014 11:38:44 -0600 Subject: [PATCH] Move TC debug options to one file --- arch/arm/src/sama5/sam_freerun.c | 15 --------------- arch/arm/src/sama5/sam_tc.c | 25 ------------------------- arch/arm/src/sama5/sam_tc.h | 27 +++++++++++++++++++++++++++ arch/arm/src/sama5/sam_tickless.c | 18 ++---------------- 4 files changed, 29 insertions(+), 56 deletions(-) diff --git a/arch/arm/src/sama5/sam_freerun.c b/arch/arm/src/sama5/sam_freerun.c index 1c742ec49c..b4813c57c0 100644 --- a/arch/arm/src/sama5/sam_freerun.c +++ b/arch/arm/src/sama5/sam_freerun.c @@ -54,7 +54,6 @@ #include #include #include -#include #include @@ -66,20 +65,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifdef CONFIG_SAMA5_TC_DEBUG -# define tcdbg dbg -# define tcvdbg vdbg -# define tcdbg lldbg -# define tcvdbg llvdbg -# define tclldbg lldbg -# define tcllvdbg llvdbg -#else -# define tcdbg(x...) -# define tcvdbg(x...) -# define tclldbg(x...) -# define tcllvdbg(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/sama5/sam_tc.c b/arch/arm/src/sama5/sam_tc.c index c553985462..64697d29bc 100644 --- a/arch/arm/src/sama5/sam_tc.c +++ b/arch/arm/src/sama5/sam_tc.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include @@ -75,30 +74,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Timer debug is enabled if any timer client is enabled */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_ANALOG -# undef CONFIG_SAMA5_TC_REGDEBUG -#endif - -#undef CONFIG_SAMA5_TC_DEBUG -#if defined(CONFIG_SAMA5_ADC) && defined(CONFIG_DEBUG_ANALOG) -# define CONFIG_SAMA5_TC_DEBUG 1 -#endif - -#ifdef CONFIG_SAMA5_TC_DEBUG -# define tcdbg dbg -# define tcvdbg vdbg -# define tclldbg llbg -# define tcllvdbg llvdbg -#else -# define tcdbg(x...) -# define tcvdbg(x...) -# define tclldbg(x...) -# define tcllvdbg(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/sama5/sam_tc.h b/arch/arm/src/sama5/sam_tc.h index c7175347c4..174f491a38 100644 --- a/arch/arm/src/sama5/sam_tc.h +++ b/arch/arm/src/sama5/sam_tc.h @@ -43,6 +43,7 @@ #include #include +#include #include "chip.h" #include "chip/sam_tc.h" @@ -71,6 +72,32 @@ #define TC_REGB 1 #define TC_REGC 2 +/* Timer debug is enabled if any timer client is enabled */ + +#ifndef CONFIG_DEBUG +# undef CONFIG_DEBUG_ANALOG +# undef CONFIG_SAMA5_TC_REGDEBUG +#endif + +#undef CONFIG_SAMA5_TC_DEBUG +#if defined(CONFIG_SAMA5_ADC) && defined(CONFIG_DEBUG_ANALOG) +# define CONFIG_SAMA5_TC_DEBUG 1 +#endif + +/* Timer/counter debug output */ + +#ifdef CONFIG_SAMA5_TC_DEBUG +# define tcdbg dbg +# define tcvdbg vdbg +# define tclldbg lldbg +# define tcllvdbg llvdbg +#else +# define tcdbg(x...) +# define tcvdbg(x...) +# define tclldbg(x...) +# define tcllvdbg(x...) +#endif + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/arm/src/sama5/sam_tickless.c b/arch/arm/src/sama5/sam_tickless.c index cbe8262e9d..5999e88fda 100644 --- a/arch/arm/src/sama5/sam_tickless.c +++ b/arch/arm/src/sama5/sam_tickless.c @@ -63,7 +63,6 @@ #include #include -#include #include @@ -148,20 +147,6 @@ # error CONFIG_SAMA5_TICKLESS_FREERUN is the same as CONFIG_SAMA5_TICKLESS_ONESHOT #endif -#ifdef CONFIG_SAMA5_TC_DEBUG -# define tcdbg dbg -# define tcvdbg vdbg -# define tcdbg lldbg -# define tcvdbg llvdbg -# define tclldbg lldbg -# define tcllvdbg llvdbg -#else -# define tcdbg(x...) -# define tcvdbg(x...) -# define tclldbg(x...) -# define tcllvdbg(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ @@ -325,7 +310,8 @@ int up_timer_gettime(FAR struct timespec *ts) * * Input Parameters: * ts - Location to return the remaining time. Zero should be returned - * if the timer is not active. + * if the timer is not active. ts may be zero in which case the + * time remaining is not returned. * * Returned Value: * Zero (OK) is returned on success. A call to up_timer_cancel() when