Skip to content

Commit

Permalink
drivers: adc: stm32: allow to use multiple ADCs with STM32F3 series
Browse files Browse the repository at this point in the history
STM32F3 have multiple ADCs that share the same IRQ.

Signed-off-by: Rihards Skuja <[email protected]>
  • Loading branch information
or-rhssk authored and carlescufi committed May 22, 2023
1 parent 2f94760 commit ecc3315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/adc/Kconfig.stm32
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ config ADC_STM32_DMA
Enable the ADC DMA mode for ADC instances
that enable dma channels in their device tree node.

if SOC_SERIES_STM32F2X || SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X || SOC_SERIES_STM32G4X
if SOC_SERIES_STM32F2X || (SOC_SERIES_STM32F3X && !SOC_STM32F373XC) || SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X || SOC_SERIES_STM32G4X

config ADC_STM32_SHARED_IRQS
bool "STM32 ADC shared interrupts"
Expand Down
8 changes: 4 additions & 4 deletions drivers/adc/adc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,11 +1393,11 @@ static const struct adc_driver_api api_stm32_driver_api = {

bool adc_stm32_is_irq_active(ADC_TypeDef *adc)
{
#if defined(CONFIG_SOC_SERIES_STM32G4X)
return LL_ADC_IsActiveFlag_EOC(adc) ||
#else
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_adc)
return LL_ADC_IsActiveFlag_EOCS(adc) ||
#endif /* CONFIG_SOC_SERIES_STM32G4X */
#else
return LL_ADC_IsActiveFlag_EOC(adc) ||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_adc) */
LL_ADC_IsActiveFlag_OVR(adc) ||
LL_ADC_IsActiveFlag_JEOS(adc) ||
LL_ADC_IsActiveFlag_AWD1(adc);
Expand Down

0 comments on commit ecc3315

Please sign in to comment.