Misc fixes to quadrature encoder debug output

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4411 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-02-21 23:23:18 +00:00
parent 9ee1f7838e
commit b7fcd27d48
2 changed files with 14 additions and 7 deletions

View File

@ -77,18 +77,18 @@
# ifdef CONFIG_DEBUG_VERBOSE
# define qevdbg vdbg
# define qellvdbg llvdbg
# define stm32_dumpgpio(p,m) stm32_dumpgpio(p,m)
# define qe_dumpgpio(p,m) stm32_dumpgpio(p,m)
# else
# define qelldbg(x...)
# define qevdbg(x...)
# define qellvdbg(x...)
# define stm32_dumpgpio(p,m)
# define qe_dumpgpio(p,m)
# endif
#else
# define qedbg(x...)
# define qelldbg(x...)
# define qevdbg(x...)
# define qellvdbg(x...)
# define stm32_dumpgpio(p,m)
# define qe_dumpgpio(p,m)
#endif
/************************************************************************************
@ -604,6 +604,7 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower)
uint16_t ccmr1;
uint16_t ccer;
uint16_t cr1;
uint16_t regval;
int ret;
/* NOTE: Clocking should have been enabled in the low-level RCC logic at boot-up */
@ -754,7 +755,12 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower)
cr1 &= ~GTIM_CR1_URS;
stm32_putreg16(priv, STM32_GTIM_CR1_OFFSET, cr1);
/* Enable the update interrupt */
/* Clear any pending update interrupts */
regval = stm32_getreg16(priv, STM32_GTIM_SR_OFFSET);
stm32_putreg16(priv, STM32_GTIM_SR_OFFSET, regval & ~GTIM_SR_UIF)
/* Then enable the update interrupt */
dier = stm32_getreg16(priv, STM32_GTIM_DIER_OFFSET);
dier |= GTIM_DIER_UIE;
@ -947,6 +953,7 @@ static int stm32_reset(FAR struct qe_lowerhalf_s *lower)
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
irqstate_t flags;
qevdbg("Resetting position to zero\n");
DEBUGASSERT(lower && priv->inuse);
/* Reset the timer and the counter. Interrupts are disabled to make this atomic

View File

@ -89,7 +89,7 @@
# define qevdbg vdbg
# define qellvdbg llvdbg
# else
# define qelldbg(x...)
# define qevdbg(x...)
# define qellvdbg(x...)
# endif
#else
@ -118,7 +118,7 @@
int qe_devinit(void)
{
static initialized = false;
static bool initialized = false;
int ret;
/* Check if we are already initialized */