STM32 ADC driver fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5247 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
c7d4c6e961
commit
0c641abb63
2 changed files with 8 additions and 4 deletions
|
|
@ -694,10 +694,10 @@ static int adc_timinit(FAR struct stm32_dev_s *priv)
|
|||
|
||||
case 4: /* TimerX TRGO event */
|
||||
{
|
||||
#warning "TRGO support not yet implemented"
|
||||
|
||||
/* TODO: TRGO support not yet implemented */
|
||||
/* Set the event TRGO */
|
||||
|
||||
ccenable = 0;
|
||||
egr = GTIM_EGR_TG;
|
||||
|
||||
/* Set the duty cycle by writing to the CCR register for this channel */
|
||||
|
|
@ -971,7 +971,7 @@ static void adc_reset(FAR struct adc_dev_s *dev)
|
|||
avdbg("intf: ADC%d\n", priv->intf);
|
||||
flags = irqsave();
|
||||
|
||||
/* Enable ADC reset state */
|
||||
/* Enable ADC reset state */
|
||||
|
||||
adc_rccreset(priv, true);
|
||||
|
||||
|
|
@ -1164,6 +1164,10 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
|||
ret = irq_attach(priv->irq, priv->isr);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Make sure that the ADC device is in the powered up, reset state */
|
||||
|
||||
adc_reset(dev);
|
||||
|
||||
/* Enable the ADC interrupt */
|
||||
|
||||
avdbg("Enable the ADC interrupt: irq=%d\n", priv->irq);
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@
|
|||
|
||||
#if defined(ADC1_HAVE_TIMER) || defined(ADC2_HAVE_TIMER) || defined(ADC3_HAVE_TIMER)
|
||||
# define ADC_HAVE_TIMER 1
|
||||
# if defined(CONFIG_STM32_STM32F10XX) && defined(CONFIG_STM32_FORCEPOWER)
|
||||
# if defined(CONFIG_STM32_STM32F10XX) && !defined(CONFIG_STM32_FORCEPOWER)
|
||||
# warning "CONFIG_STM32_FORCEPOWER must be defined to enable the timer(s)"
|
||||
# endif
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue