From db562b774a5fc46ddbe6d2e7f4b91ff3408af4c0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 16 Dec 2014 09:54:32 -0600 Subject: [PATCH] Unify sensor debug. ADX driver was using input debug; LM75 and QENCODE that their own custom debug. Now all use CONFIG_DEBUG_SENSOR, sndbg() --- configs/mikroe-stm32f4/src/up_qencoder.c | 28 ++----------------- configs/stm32f3discovery/src/up_qencoder.c | 28 ++----------------- configs/stm32f429i-disco/README.txt | 4 +-- configs/stm32f4discovery/README.txt | 4 +-- configs/stm32f4discovery/src/stm32_qencoder.c | 28 ++----------------- configs/stm32ldiscovery/src/stm32_qencoder.c | 28 ++----------------- 6 files changed, 12 insertions(+), 108 deletions(-) diff --git a/configs/mikroe-stm32f4/src/up_qencoder.c b/configs/mikroe-stm32f4/src/up_qencoder.c index 19e133131b..69b9f2af5d 100644 --- a/configs/mikroe-stm32f4/src/up_qencoder.c +++ b/configs/mikroe-stm32f4/src/up_qencoder.c @@ -118,30 +118,6 @@ #ifdef HAVE_QENCODER -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing the quadrature encoder */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_QENCODER -#endif - -#ifdef CONFIG_DEBUG_QENCODER -# define qedbg dbg -# define qelldbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define qevdbg vdbg -# define qellvdbg llvdbg -# else -# define qevdbg(x...) -# define qellvdbg(x...) -# endif -#else -# define qedbg(x...) -# define qelldbg(x...) -# define qevdbg(x...) -# define qellvdbg(x...) -#endif - /************************************************************************************ * Private Functions ************************************************************************************/ @@ -170,11 +146,11 @@ int qe_devinit(void) { /* Initialize a quadrature encoder interface. */ - qevdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); + snvdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - qedbg("stm32_qeinitialize failed: %d\n", ret); + sndbg("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32f3discovery/src/up_qencoder.c b/configs/stm32f3discovery/src/up_qencoder.c index a3cabbd9fe..14a0ad7df2 100644 --- a/configs/stm32f3discovery/src/up_qencoder.c +++ b/configs/stm32f3discovery/src/up_qencoder.c @@ -118,30 +118,6 @@ #ifdef HAVE_QENCODER -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing the quadrature encoder */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_QENCODER -#endif - -#ifdef CONFIG_DEBUG_QENCODER -# define qedbg dbg -# define qelldbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define qevdbg vdbg -# define qellvdbg llvdbg -# else -# define qevdbg(x...) -# define qellvdbg(x...) -# endif -#else -# define qedbg(x...) -# define qelldbg(x...) -# define qevdbg(x...) -# define qellvdbg(x...) -#endif - /************************************************************************************ * Private Functions ************************************************************************************/ @@ -170,11 +146,11 @@ int qe_devinit(void) { /* Initialize a quadrature encoder interface. */ - qevdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); + snvdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - qedbg("stm32_qeinitialize failed: %d\n", ret); + sndbg("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32f429i-disco/README.txt b/configs/stm32f429i-disco/README.txt index ae993416bf..d8e1783fbf 100644 --- a/configs/stm32f429i-disco/README.txt +++ b/configs/stm32f429i-disco/README.txt @@ -651,9 +651,9 @@ Where is one of the following: CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder CONFIG_STM32_TIM2_QE=y : (Or optionally TIM2) - See also apps/examples/README.tx. Special PWM-only debug options: + See also apps/examples/README.txt. Special debug options: - CONFIG_DEBUG_QENCODER + CONFIG_DEBUG_SENSORS 6. This example supports the watchdog timer test (apps/examples/watchdog) but this must be manually enabled by selecting: diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index c16c55bbdb..c45e477d08 100644 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -1438,9 +1438,9 @@ Where is one of the following: CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder CONFIG_STM32_TIM2_QE=y : (Or optionally TIM2) - See also apps/examples/README.tx. Special PWM-only debug options: + See also apps/examples/README.tx. Special debug options: - CONFIG_DEBUG_QENCODER + CONFIG_DEBUG_SENSORS 6. This example supports the watchdog timer test (apps/examples/watchdog) but this must be manually enabled by selecting: diff --git a/configs/stm32f4discovery/src/stm32_qencoder.c b/configs/stm32f4discovery/src/stm32_qencoder.c index 850da62d9a..67316b30a2 100644 --- a/configs/stm32f4discovery/src/stm32_qencoder.c +++ b/configs/stm32f4discovery/src/stm32_qencoder.c @@ -117,30 +117,6 @@ #ifdef HAVE_QENCODER -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing the quadrature encoder */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_QENCODER -#endif - -#ifdef CONFIG_DEBUG_QENCODER -# define qedbg dbg -# define qelldbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define qevdbg vdbg -# define qellvdbg llvdbg -# else -# define qevdbg(x...) -# define qellvdbg(x...) -# endif -#else -# define qedbg(x...) -# define qelldbg(x...) -# define qevdbg(x...) -# define qellvdbg(x...) -#endif - /************************************************************************************ * Private Functions ************************************************************************************/ @@ -169,11 +145,11 @@ int qe_devinit(void) { /* Initialize a quadrature encoder interface. */ - qevdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); + snvdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - qedbg("stm32_qeinitialize failed: %d\n", ret); + sndbg("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32ldiscovery/src/stm32_qencoder.c b/configs/stm32ldiscovery/src/stm32_qencoder.c index 1c04f9c29b..feebcd3950 100644 --- a/configs/stm32ldiscovery/src/stm32_qencoder.c +++ b/configs/stm32ldiscovery/src/stm32_qencoder.c @@ -118,30 +118,6 @@ #ifdef HAVE_QENCODER -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing the quadrature encoder */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_QENCODER -#endif - -#ifdef CONFIG_DEBUG_QENCODER -# define qedbg dbg -# define qelldbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define qevdbg vdbg -# define qellvdbg llvdbg -# else -# define qevdbg(x...) -# define qellvdbg(x...) -# endif -#else -# define qedbg(x...) -# define qelldbg(x...) -# define qevdbg(x...) -# define qellvdbg(x...) -#endif - /************************************************************************************ * Private Functions ************************************************************************************/ @@ -170,11 +146,11 @@ int qe_devinit(void) { /* Initialize a quadrature encoder interface. */ - qevdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); + snvdbg("Initializing the quadrature encoder using TIM%d\n", TIMID); ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - qedbg("stm32_qeinitialize failed: %d\n", ret); + sndbg("stm32_qeinitialize failed: %d\n", ret); return ret; }