Centralize definitions associated with CONFIG_DEBUG_PWM
This commit is contained in:
parent
8ce929a915
commit
03cbe671ad
37
Kconfig
37
Kconfig
@ -1104,14 +1104,14 @@ config DEBUG_I2C_WARN
|
||||
default n
|
||||
depends on DEBUG_WARN
|
||||
---help---
|
||||
Enable I2c driver warning output to SYSLOG.
|
||||
Enable I2C driver warning output to SYSLOG.
|
||||
|
||||
config DEBUG_I2C_INFO
|
||||
bool "I2C Informational Output"
|
||||
default n
|
||||
depends on DEBUG_INFO
|
||||
---help---
|
||||
Enable I2c driver informational output to SYSLOG.
|
||||
Enable I2C driver informational output to SYSLOG.
|
||||
|
||||
endif # DEBUG_I2C
|
||||
|
||||
@ -1154,14 +1154,43 @@ config DEBUG_I2S_INFO
|
||||
endif # DEBUG_I2S
|
||||
|
||||
config DEBUG_PWM
|
||||
bool "PWM Debug Output"
|
||||
bool "PWM Debug Features"
|
||||
default n
|
||||
depends on PWM
|
||||
---help---
|
||||
Enable PWM driver debug SYSLOG output (disabled by default).
|
||||
Enable PWM debug features.
|
||||
|
||||
Support for this debug option is architecture-specific and may not
|
||||
be available for some MCUs.
|
||||
|
||||
if DEBUG_PWM
|
||||
|
||||
config DEBUG_PWM_ERROR
|
||||
bool "PWM Error Output"
|
||||
default n
|
||||
depends on DEBUG_ERROR
|
||||
---help---
|
||||
Enable PWM driver error output to SYSLOG.
|
||||
|
||||
Support for this debug option is architecture-specific and may not
|
||||
be available for some MCUs.
|
||||
|
||||
config DEBUG_PWM_WARN
|
||||
bool "PWM Warnings Output"
|
||||
default n
|
||||
depends on DEBUG_WARN
|
||||
---help---
|
||||
Enable PWM driver warning output to SYSLOG.
|
||||
|
||||
config DEBUG_PWM_INFO
|
||||
bool "PWM Informational Output"
|
||||
default n
|
||||
depends on DEBUG_INFO
|
||||
---help---
|
||||
Enable PWM driver informational output to SYSLOG.
|
||||
|
||||
endif # DEBUG_PWM
|
||||
|
||||
config DEBUG_RTC
|
||||
bool "RTC Debug Output"
|
||||
default n
|
||||
|
@ -75,29 +75,10 @@
|
||||
/* The following definitions are used to identify the various time types */
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) efm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -136,7 +117,7 @@ static uint32_t pwm_getreg(struct efm32_pwmtimer_s *priv, int offset);
|
||||
static void pwm_putreg(struct efm32_pwmtimer_s *priv, int offset,
|
||||
uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
@ -323,7 +304,7 @@ static void pwm_putreg(struct efm32_pwmtimer_s *priv, int offset, uint32_t value
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg)
|
||||
{
|
||||
/* TODO debug pwm_dumpregs */
|
||||
@ -843,7 +824,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -76,29 +76,10 @@
|
||||
/* PWM/Timer Definitions ****************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) kinetis_pindump(p,m)
|
||||
# else
|
||||
# define pwmllerr(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -126,7 +107,7 @@ struct kinetis_pwmtimer_s
|
||||
static uint32_t pwm_getreg(struct kinetis_pwmtimer_s *priv, int offset);
|
||||
static void pwm_putreg(struct kinetis_pwmtimer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct kinetis_pwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
@ -260,7 +241,7 @@ static void pwm_putreg(struct kinetis_pwmtimer_s *priv, int offset, uint32_t val
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct kinetis_pwmtimer_s *priv, FAR const char *msg)
|
||||
{
|
||||
int nchannels = (priv->tpmid == 0) ? 8 : 2;
|
||||
@ -739,7 +720,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct kinetis_pwmtimer_s *priv = (FAR struct kinetis_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -73,29 +73,10 @@
|
||||
/* PWM/Timer Definitions ****************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) kl_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -122,7 +103,7 @@ struct kl_pwmtimer_s
|
||||
static uint32_t pwm_getreg(struct kl_pwmtimer_s *priv, int offset);
|
||||
static void pwm_putreg(struct kl_pwmtimer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct kl_pwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
@ -253,7 +234,7 @@ static void pwm_putreg(struct kl_pwmtimer_s *priv, int offset, uint32_t value)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct kl_pwmtimer_s *priv, FAR const char *msg)
|
||||
{
|
||||
int nchannels = (priv->tpmid == 0) ? 6 : 2;
|
||||
@ -691,7 +672,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct kl_pwmtimer_s *priv = (FAR struct kl_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -80,31 +80,11 @@
|
||||
|
||||
#define TIMTYPE_TIM1 TIMTYPE_ADVANCED
|
||||
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) stm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -133,7 +113,7 @@ struct lpc11_timer_s
|
||||
static uint32_t timer_getreg(struct lpc11_timer_s *priv, int offset);
|
||||
static void timer_putreg(struct lpc11_timer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define timer_dumpregs(priv,msg)
|
||||
@ -242,11 +222,11 @@ static void timer_putreg(struct lpc11_timer_s *priv, int offset,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg)
|
||||
{
|
||||
pwmerr("%s:\n", msg);
|
||||
pwmerr(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n",
|
||||
pwminfo("%s:\n", msg);
|
||||
pwminfo(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n",
|
||||
timer_getreg(priv, LPC11_PWM_MR0_OFFSET),
|
||||
timer_getreg(priv, LPC11_PWM_MR1_OFFSET),
|
||||
timer_getreg(priv, LPC11_PWM_MR2_OFFSET),
|
||||
@ -254,7 +234,7 @@ static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg)
|
||||
#if defined(CONFIG_LPC11_TMR0)
|
||||
if (priv->timtype == TIMTYPE_ADVANCED)
|
||||
{
|
||||
pwmerr(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n",
|
||||
pwminfo(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n",
|
||||
timer_getreg(priv, LPC11_PWM_MR0_OFFSET),
|
||||
timer_getreg(priv, LPC11_PWM_MR1_OFFSET),
|
||||
timer_getreg(priv, LPC11_PWM_MR2_OFFSET),
|
||||
@ -263,7 +243,7 @@ static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pwmerr(" DCR: %04x DMAR: %04x\n",
|
||||
pwminfo(" DCR: %04x DMAR: %04x\n",
|
||||
timer_getreg(priv, LPC11_PWM_MR2_OFFSET),
|
||||
timer_getreg(priv, LPC11_PWM_MR3_OFFSET));
|
||||
}
|
||||
|
@ -81,29 +81,10 @@
|
||||
#define TIMTYPE_TIM1 TIMTYPE_ADVANCED
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) stm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -132,7 +113,7 @@ struct lpc17_mcpwmtimer_s
|
||||
static uint32_t mcpwm_getreg(struct lpc17_mcpwmtimer_s *priv, int offset);
|
||||
static void mcpwm_putreg(struct lpc17_mcpwmtimer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void mcpwm_dumpregs(struct lpc17_mcpwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define mcpwm_dumpregs(priv,msg)
|
||||
@ -242,7 +223,7 @@ static void mcpwm_putreg(struct lpc17_mcpwmtimer_s *priv, int offset, uint32_t v
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void mcpwm_dumpregs(FAR struct lpc17_mcpwmtimer_s *priv,
|
||||
FAR const char *msg)
|
||||
{
|
||||
@ -625,7 +606,7 @@ static int mcpwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int mcpwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct lpc17_mcpwmtimer_s *priv = (FAR struct lpc17_mcpwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -99,29 +99,10 @@
|
||||
#define TCR_PWM_EN (0x00000008)
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) stm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -150,7 +131,7 @@ struct lpc17_pwmtimer_s
|
||||
static uint32_t pwm_getreg(struct lpc17_pwmtimer_s *priv, int offset);
|
||||
static void pwm_putreg(struct lpc17_pwmtimer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct lpc17_pwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
@ -258,7 +239,7 @@ static void pwm_putreg(struct lpc17_pwmtimer_s *priv, int offset, uint32_t value
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct lpc17_pwmtimer_s *priv, FAR const char *msg)
|
||||
{
|
||||
pwminfo("%s:\n", msg);
|
||||
@ -596,7 +577,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct lpc17_pwmtimer_s *priv = (FAR struct lpc17_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -82,29 +82,10 @@
|
||||
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) stm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -133,7 +114,7 @@ struct lpc17_timer_s
|
||||
static uint32_t timer_getreg(struct lpc17_timer_s *priv, int offset);
|
||||
static void timer_putreg(struct lpc17_timer_s *priv, int offset, uint32_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define timer_dumpregs(priv,msg)
|
||||
@ -242,11 +223,11 @@ static void timer_putreg(struct lpc17_timer_s *priv, int offset,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg)
|
||||
{
|
||||
pwmerr("%s:\n", msg);
|
||||
pwmerr(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n",
|
||||
pwminfo("%s:\n", msg);
|
||||
pwminfo(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n",
|
||||
timer_getreg(priv, LPC17_PWM_MR0_OFFSET),
|
||||
timer_getreg(priv, LPC17_PWM_MR1_OFFSET),
|
||||
timer_getreg(priv, LPC17_PWM_MR2_OFFSET),
|
||||
@ -254,7 +235,7 @@ static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg)
|
||||
#if defined(CONFIG_LPC17_TMR0)
|
||||
if (priv->timtype == TIMTYPE_ADVANCED)
|
||||
{
|
||||
pwmerr(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n",
|
||||
pwminfo(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n",
|
||||
timer_getreg(priv, LPC17_PWM_MR0_OFFSET),
|
||||
timer_getreg(priv, LPC17_PWM_MR1_OFFSET),
|
||||
timer_getreg(priv, LPC17_PWM_MR2_OFFSET),
|
||||
@ -263,7 +244,7 @@ static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pwmerr(" DCR: %04x DMAR: %04x\n",
|
||||
pwminfo(" DCR: %04x DMAR: %04x\n",
|
||||
timer_getreg(priv, LPC17_PWM_MR2_OFFSET),
|
||||
timer_getreg(priv, LPC17_PWM_MR3_OFFSET));
|
||||
}
|
||||
|
@ -393,30 +393,6 @@
|
||||
#define PWM_PINMASK (PIO_PORT_MASK | PIO_PIN_MASK)
|
||||
#define PWM_MKINPUT(cfg) (((cfg) & PWM_PINMASK) | PWM_INPUTCFG)
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
@ -480,7 +456,7 @@ static bool pwm_checkreg(FAR struct sam_pwm_s *chan, bool wr, uint32_t regval,
|
||||
static uint32_t pwm_getreg(FAR struct sam_pwm_chan_s *chan, int offset);
|
||||
static void pwm_putreg(FAR struct sam_pwm_chan_s *chan, int offset, uint32_t regval);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(FAR struct sam_pwm_chan_s *chan, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(chan,msg)
|
||||
@ -914,7 +890,7 @@ static void pwm_chan_putreg(struct sam_pwm_chan_s *chan, int offset,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct sam_pwm_chan_s *chan, FAR const char *msg)
|
||||
{
|
||||
pwminfo("PWM: %s\n", msg);
|
||||
@ -1231,7 +1207,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct sam_pwm_chan_s *chan = (FAR struct sam_pwm_chan_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -115,29 +115,10 @@
|
||||
#define TIMTYPE_TIM17 TIMTYPE_COUNTUP16
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_PWM
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwm_dumpgpio(p,m) stm32_dumpgpio(p,m)
|
||||
# else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
# endif
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
# define pwm_dumpgpio(p,m)
|
||||
#endif
|
||||
|
||||
@ -204,7 +185,7 @@ struct stm32_pwmtimer_s
|
||||
static uint16_t pwm_getreg(struct stm32_pwmtimer_s *priv, int offset);
|
||||
static void pwm_putreg(struct stm32_pwmtimer_s *priv, int offset, uint16_t value);
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct stm32_pwmtimer_s *priv, FAR const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
@ -969,7 +950,7 @@ static void pwm_putreg(struct stm32_pwmtimer_s *priv, int offset, uint16_t value
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct stm32_pwmtimer_s *priv, FAR const char *msg)
|
||||
{
|
||||
pwminfo("%s:\n", msg);
|
||||
@ -2383,7 +2364,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct stm32_pwmtimer_s *priv = (FAR struct stm32_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
@ -53,37 +53,6 @@
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwminfo info
|
||||
# define pwmllerr llerr
|
||||
# define pwmllinfo llinfo
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwmllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -989,7 +989,7 @@ Where <subdir> is one of the following:
|
||||
|
||||
Special PWM-only debug options:
|
||||
|
||||
CONFIG_DEBUG_PWM
|
||||
CONFIG_DEBUG_PWM_INFO
|
||||
|
||||
5. This example supports the CAN loopback test (apps/examples/can) but this
|
||||
must be manually enabled by selecting:
|
||||
|
@ -1165,7 +1165,7 @@ Where <subdir> is one of the following:
|
||||
|
||||
Special PWM-only debug options:
|
||||
|
||||
CONFIG_DEBUG_PWM
|
||||
CONFIG_DEBUG_PWM_INFO
|
||||
|
||||
5. This example supports the CAN loopback test (apps/examples/can) but this
|
||||
must be manually enabled by selecting:
|
||||
|
@ -563,7 +563,7 @@ Where <subdir> is one of the following:
|
||||
|
||||
Special PWM-only debug options:
|
||||
|
||||
CONFIG_DEBUG_PWM
|
||||
CONFIG_DEBUG_PWM_INFO
|
||||
|
||||
7. USB Support (CDC/ACM device)
|
||||
|
||||
|
@ -640,7 +640,7 @@ Where <subdir> is one of the following:
|
||||
|
||||
Special PWM-only debug options:
|
||||
|
||||
CONFIG_DEBUG_PWM
|
||||
CONFIG_DEBUG_PWM_INFO
|
||||
|
||||
5. This example supports the Quadrature Encode test (apps/examples/qencoder)
|
||||
but this must be manually enabled by selecting:
|
||||
|
@ -1566,7 +1566,7 @@ Where <subdir> is one of the following:
|
||||
|
||||
Special PWM-only debug options:
|
||||
|
||||
CONFIG_DEBUG_PWM
|
||||
CONFIG_DEBUG_PWM_INFO
|
||||
|
||||
5. This example supports the Quadrature Encode test (apps/examples/qencoder)
|
||||
but this must be manually enabled by selecting:
|
||||
|
@ -64,24 +64,6 @@
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing PWM */
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerr err
|
||||
# define pwminfo info
|
||||
# define pwmllerr llerr
|
||||
# define pwmllinfo llinfo
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwminfo(x...)
|
||||
# define pwmllerr(x...)
|
||||
# define pwmllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Definitions
|
||||
****************************************************************************/
|
||||
|
@ -693,6 +693,30 @@
|
||||
# define i2sllinfo(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_ERROR
|
||||
# define pwmerr(format, ...) err(format, ##__VA_ARGS__)
|
||||
# define pwmllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define pwmerr(x...)
|
||||
# define pwmllerr(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_WARN
|
||||
# define pwmwarn(format, ...) warn(format, ##__VA_ARGS__)
|
||||
# define pwmllwarn(format, ...) llwarn(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define pwmwarn(x...)
|
||||
# define pwmllwarn(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwminfo(format, ...) info(format, ##__VA_ARGS__)
|
||||
# define pwmllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define pwminfo(x...)
|
||||
# define pwmllinfo(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_ERROR
|
||||
# define snerr(format, ...) err(format, ##__VA_ARGS__)
|
||||
# define snllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
||||
@ -1282,6 +1306,30 @@
|
||||
# define i2sllinfo (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_ERROR
|
||||
# define pwmerr err
|
||||
# define pwmllerr llerr
|
||||
#else
|
||||
# define pwmerr (void)
|
||||
# define pwmllerr (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_WARN
|
||||
# define pwmwarn warn
|
||||
# define pwmllwarn llwarn
|
||||
#else
|
||||
# define pwmwarn (void)
|
||||
# define pwmllwarn (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
# define pwminfo info
|
||||
# define pwmllinfo llinfo
|
||||
#else
|
||||
# define pwminfo (void)
|
||||
# define pwmllinfo (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_ERROR
|
||||
# define snerr err
|
||||
# define snllerr llerr
|
||||
@ -1508,6 +1556,14 @@
|
||||
# define i2sinfodumpbuffer(m,b,n)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM
|
||||
# define pwmerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
|
||||
# define pwminfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
|
||||
#else
|
||||
# define pwmerrdumpbuffer(m,b,n)
|
||||
# define pwminfodumpbuffer(m,b,n)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS
|
||||
# define snerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
|
||||
# define sninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
|
||||
|
@ -72,8 +72,7 @@
|
||||
* number of pulses. This might be used, for example to support a stepper
|
||||
* motor. If the hardware will support a fixed pulse count, then this
|
||||
* configuration should be set to enable the capability.
|
||||
* CONFIG_DEBUG_PWM - If enabled (with CONFIG_DEBUG_FEATURES and, optionally,
|
||||
* CONFIG_DEBUG_INFO), this will generate output that can be use dto
|
||||
* CONFIG_DEBUG_PWM_INFO - This will generate output that can be use to
|
||||
* debug the PWM driver.
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user