Fix the Value Line adc IRQ number selection

This commit is contained in:
David Sidrane
2016-05-31 13:58:52 -10:00
parent 6940fe9655
commit 70f2b47a0d
2 changed files with 26 additions and 28 deletions
-1
View File
@@ -1182,7 +1182,6 @@ config STM32_VALUELINE
select STM32_HAVE_TIM15 select STM32_HAVE_TIM15
select STM32_HAVE_TIM16 select STM32_HAVE_TIM16
select STM32_HAVE_TIM17 select STM32_HAVE_TIM17
select STM32_HAVE_ADC2
select STM32_HAVE_SPI2 if STM32_HIGHDENSITY select STM32_HAVE_SPI2 if STM32_HIGHDENSITY
select STM32_HAVE_SPI3 if STM32_HIGHDENSITY select STM32_HAVE_SPI3 if STM32_HIGHDENSITY
+26 -27
View File
@@ -344,22 +344,20 @@ static void adc_rccreset(FAR struct stm32_dev_s *priv, bool reset);
/* ADC Interrupt Handler */ /* ADC Interrupt Handler */
static int adc_interrupt(FAR struct adc_dev_s *dev); static int adc_interrupt(FAR struct adc_dev_s *dev);
#ifdef CONFIG_STM32_STM32L15XX #if defined(STM32_IRQ_ADC1) && defined(CONFIG_STM32_ADC1)
static int adc1_interrupt(int irq, FAR void *context); static int adc1_interrupt(int irq, FAR void *context);
#endif #endif
#if (defined(CONFIG_STM32_STM32F10XX) || \ #if defined(STM32_IRQ_ADC12) && (defined(CONFIG_STM32_ADC1) || \
defined(CONFIG_STM32_STM32F30XX)) && \ defined(CONFIG_STM32_ADC2))
(defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2))
static int adc12_interrupt(int irq, FAR void *context); static int adc12_interrupt(int irq, FAR void *context);
#endif #endif
#if (defined(CONFIG_STM32_STM32F10XX) || \ #if (defined(STM32_IRQ_ADC3) && defined(CONFIG_STM32_ADC3))
defined(CONFIG_STM32_STM32F30XX)) && defined(CONFIG_STM32_ADC3)
static int adc3_interrupt(int irq, FAR void *context); static int adc3_interrupt(int irq, FAR void *context);
#endif #endif
#if defined(CONFIG_STM32_STM32F30XX) && defined(CONFIG_STM32_ADC4) #if defined(STM32_IRQ_ADC4) && defined(CONFIG_STM32_ADC4)
static int adc4_interrupt(int irq, FAR void *context); static int adc4_interrupt(int irq, FAR void *context);
#endif #endif
#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) #if defined(STM32_IRQ_ADC)
static int adc123_interrupt(int irq, FAR void *context); static int adc123_interrupt(int irq, FAR void *context);
#endif #endif
@@ -433,15 +431,17 @@ static const struct adc_ops_s g_adcops =
#ifdef CONFIG_STM32_ADC1 #ifdef CONFIG_STM32_ADC1
static struct stm32_dev_s g_adcpriv1 = static struct stm32_dev_s g_adcpriv1 =
{ {
#if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) #if defined(STM32_IRQ_ADC1)
.irq = STM32_IRQ_ADC12,
.isr = adc12_interrupt,
#elif defined(CONFIG_STM32_STM32L15XX)
.irq = STM32_IRQ_ADC1, .irq = STM32_IRQ_ADC1,
.isr = adc1_interrupt, .isr = adc1_interrupt,
#else #elif defined(STM32_IRQ_ADC12)
.irq = STM32_IRQ_ADC12,
.isr = adc12_interrupt,
#elif defined(STM32_IRQ_ADC)
.irq = STM32_IRQ_ADC, .irq = STM32_IRQ_ADC,
.isr = adc123_interrupt, .isr = adc123_interrupt,
#else
# error "No STM32_IRQ_ADC1 STM32_IRQ_ADC12 or STM32_IRQ_ADC defined for CONFIG_STM32_ADC1"
#endif #endif
.intf = 1, .intf = 1,
.base = STM32_ADC1_BASE, .base = STM32_ADC1_BASE,
@@ -470,12 +470,14 @@ static struct adc_dev_s g_adcdev1 =
#ifdef CONFIG_STM32_ADC2 #ifdef CONFIG_STM32_ADC2
static struct stm32_dev_s g_adcpriv2 = static struct stm32_dev_s g_adcpriv2 =
{ {
#if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) #if defined(STM32_IRQ_ADC12)
.irq = STM32_IRQ_ADC12, .irq = STM32_IRQ_ADC12,
.isr = adc12_interrupt, .isr = adc12_interrupt,
#else #elif defined(STM32_IRQ_ADC)
.irq = STM32_IRQ_ADC, .irq = STM32_IRQ_ADC,
.isr = adc123_interrupt, .isr = adc123_interrupt,
#else
# error "No STM32_IRQ_ADC12 or STM32_IRQ_ADC defined for CONFIG_STM32_ADC2"
#endif #endif
.intf = 2, .intf = 2,
.base = STM32_ADC2_BASE, .base = STM32_ADC2_BASE,
@@ -504,12 +506,14 @@ static struct adc_dev_s g_adcdev2 =
#ifdef CONFIG_STM32_ADC3 #ifdef CONFIG_STM32_ADC3
static struct stm32_dev_s g_adcpriv3 = static struct stm32_dev_s g_adcpriv3 =
{ {
#if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) #if defined(STM32_IRQ_ADC3)
.irq = STM32_IRQ_ADC3, .irq = STM32_IRQ_ADC3,
.isr = adc3_interrupt, .isr = adc3_interrupt,
#else #elif defined(STM32_IRQ_ADC)
.irq = STM32_IRQ_ADC, .irq = STM32_IRQ_ADC,
.isr = adc123_interrupt, .isr = adc123_interrupt,
#else
# error "No STM32_IRQ_ADC3 or STM32_IRQ_ADC defined for CONFIG_STM32_ADC3"
#endif #endif
.intf = 3, .intf = 3,
.base = STM32_ADC3_BASE, .base = STM32_ADC3_BASE,
@@ -2781,7 +2785,7 @@ static int adc_interrupt(FAR struct adc_dev_s *dev)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX #if defined(STM32_IRQ_ADC1)
static int adc1_interrupt(int irq, FAR void *context) static int adc1_interrupt(int irq, FAR void *context)
{ {
adc_interrupt(&g_adcdev1); adc_interrupt(&g_adcdev1);
@@ -2802,8 +2806,7 @@ static int adc1_interrupt(int irq, FAR void *context)
* *
****************************************************************************/ ****************************************************************************/
#if (defined(CONFIG_STM32_STM32F10XX) || \ #if defined(STM32_IRQ_ADC12) && \
defined(CONFIG_STM32_STM32F30XX)) && \
(defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2)) (defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2))
static int adc12_interrupt(int irq, FAR void *context) static int adc12_interrupt(int irq, FAR void *context)
{ {
@@ -2831,8 +2834,7 @@ static int adc12_interrupt(int irq, FAR void *context)
* *
****************************************************************************/ ****************************************************************************/
#if (defined(CONFIG_STM32_STM32F10XX) || \ #if defined(STM32_IRQ_ADC3) && defined(CONFIG_STM32_ADC3)
defined(CONFIG_STM32_STM32F30XX)) && defined(CONFIG_STM32_ADC3)
static int adc3_interrupt(int irq, FAR void *context) static int adc3_interrupt(int irq, FAR void *context)
{ {
adc_interrupt(&g_adcdev3); adc_interrupt(&g_adcdev3);
@@ -2853,13 +2855,10 @@ static int adc3_interrupt(int irq, FAR void *context)
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_STM32_STM32F30XX) && defined(CONFIG_STM32_ADC4) #if defined(STM32_IRQ_ADC4) && defined(CONFIG_STM32_ADC4)
static int adc4_interrupt(int irq, FAR void *context) static int adc4_interrupt(int irq, FAR void *context)
{ {
#ifdef CONFIG_STM32_ADC4
adc_interrupt(&g_adcdev4); adc_interrupt(&g_adcdev4);
#endif
return OK; return OK;
} }
#endif #endif
@@ -2876,7 +2875,7 @@ static int adc4_interrupt(int irq, FAR void *context)
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) #if defined(STM32_IRQ_ADC)
static int adc123_interrupt(int irq, FAR void *context) static int adc123_interrupt(int irq, FAR void *context)
{ {
#ifdef CONFIG_STM32_ADC1 #ifdef CONFIG_STM32_ADC1