mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Unify sensor debug. ADX driver was using input debug; LM75 and QENCODE that their own custom debug. Now all use CONFIG_DEBUG_SENSOR, sndbg()
This commit is contained in:
@@ -118,30 +118,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_QENCODER
|
#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
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
@@ -170,11 +146,11 @@ int qe_devinit(void)
|
|||||||
{
|
{
|
||||||
/* Initialize a quadrature encoder interface. */
|
/* 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);
|
ret = stm32_qeinitialize("/dev/qe0", TIMID);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
qedbg("stm32_qeinitialize failed: %d\n", ret);
|
sndbg("stm32_qeinitialize failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,30 +118,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_QENCODER
|
#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
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
@@ -170,11 +146,11 @@ int qe_devinit(void)
|
|||||||
{
|
{
|
||||||
/* Initialize a quadrature encoder interface. */
|
/* 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);
|
ret = stm32_qeinitialize("/dev/qe0", TIMID);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
qedbg("stm32_qeinitialize failed: %d\n", ret);
|
sndbg("stm32_qeinitialize failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -651,9 +651,9 @@ Where <subdir> is one of the following:
|
|||||||
CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder
|
CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder
|
||||||
CONFIG_STM32_TIM2_QE=y : (Or optionally TIM2)
|
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)
|
6. This example supports the watchdog timer test (apps/examples/watchdog)
|
||||||
but this must be manually enabled by selecting:
|
but this must be manually enabled by selecting:
|
||||||
|
|||||||
@@ -1438,9 +1438,9 @@ Where <subdir> is one of the following:
|
|||||||
CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder
|
CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder
|
||||||
CONFIG_STM32_TIM2_QE=y : (Or optionally TIM2)
|
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)
|
6. This example supports the watchdog timer test (apps/examples/watchdog)
|
||||||
but this must be manually enabled by selecting:
|
but this must be manually enabled by selecting:
|
||||||
|
|||||||
@@ -117,30 +117,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_QENCODER
|
#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
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
@@ -169,11 +145,11 @@ int qe_devinit(void)
|
|||||||
{
|
{
|
||||||
/* Initialize a quadrature encoder interface. */
|
/* 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);
|
ret = stm32_qeinitialize("/dev/qe0", TIMID);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
qedbg("stm32_qeinitialize failed: %d\n", ret);
|
sndbg("stm32_qeinitialize failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,30 +118,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_QENCODER
|
#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
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
@@ -170,11 +146,11 @@ int qe_devinit(void)
|
|||||||
{
|
{
|
||||||
/* Initialize a quadrature encoder interface. */
|
/* 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);
|
ret = stm32_qeinitialize("/dev/qe0", TIMID);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
qedbg("stm32_qeinitialize failed: %d\n", ret);
|
sndbg("stm32_qeinitialize failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user