diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-08-10 11:38:44 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-08-10 11:38:44 -0600 |
commit | 68c4f4db7658ab156b4fa95fc593c3e52cb69e76 (patch) | |
tree | e418abd5552a81acc196bd065ab886045fc2734d | |
parent | 2c40f329bc4ec83aadcdf35184c4b62239720d9b (diff) | |
download | nuttx-68c4f4db7658ab156b4fa95fc593c3e52cb69e76.tar.gz nuttx-68c4f4db7658ab156b4fa95fc593c3e52cb69e76.tar.bz2 nuttx-68c4f4db7658ab156b4fa95fc593c3e52cb69e76.zip |
Move TC debug options to one file
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_freerun.c | 15 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_tc.c | 25 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_tc.h | 27 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_tickless.c | 18 |
4 files changed, 29 insertions, 56 deletions
diff --git a/nuttx/arch/arm/src/sama5/sam_freerun.c b/nuttx/arch/arm/src/sama5/sam_freerun.c index 1c742ec49..b4813c57c 100644 --- a/nuttx/arch/arm/src/sama5/sam_freerun.c +++ b/nuttx/arch/arm/src/sama5/sam_freerun.c @@ -54,7 +54,6 @@ #include <stdbool.h> #include <assert.h> #include <errno.h> -#include <debug.h> #include <arch/irq.h> @@ -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/nuttx/arch/arm/src/sama5/sam_tc.c b/nuttx/arch/arm/src/sama5/sam_tc.c index c55398546..64697d29b 100644 --- a/nuttx/arch/arm/src/sama5/sam_tc.c +++ b/nuttx/arch/arm/src/sama5/sam_tc.c @@ -56,7 +56,6 @@ #include <semaphore.h> #include <assert.h> #include <errno.h> -#include <debug.h> #include <nuttx/arch.h> #include <arch/board/board.h> @@ -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/nuttx/arch/arm/src/sama5/sam_tc.h b/nuttx/arch/arm/src/sama5/sam_tc.h index c7175347c..174f491a3 100644 --- a/nuttx/arch/arm/src/sama5/sam_tc.h +++ b/nuttx/arch/arm/src/sama5/sam_tc.h @@ -43,6 +43,7 @@ #include <nuttx/config.h> #include <stdint.h> +#include <debug.h> #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/nuttx/arch/arm/src/sama5/sam_tickless.c b/nuttx/arch/arm/src/sama5/sam_tickless.c index cbe8262e9..5999e88fd 100644 --- a/nuttx/arch/arm/src/sama5/sam_tickless.c +++ b/nuttx/arch/arm/src/sama5/sam_tickless.c @@ -63,7 +63,6 @@ #include <stdint.h> #include <stdbool.h> -#include <debug.h> #include <nuttx/arch.h> @@ -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 |