Skip to content

Commit 649742f

Browse files
gautierg-stcarlescufi
authored andcommitted
drivers: adc: add ifdef for stm32f37x adc
Add ifdef around some functions that don't exist for STM32F37x (ADC_V2_5) like it is done for STM32F1x. Signed-off-by: Guillaume Gautier <[email protected]>
1 parent c1a6013 commit 649742f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/adc/adc_stm32.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,11 @@ static void dma_callback(const struct device *dev, void *user_data,
700700
LOG_DBG("dma callback");
701701

702702
if (channel == data->dma.channel) {
703-
#if !defined(CONFIG_SOC_SERIES_STM32F1X)
703+
#if !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5)
704704
if (LL_ADC_IsActiveFlag_OVR(adc) || (status >= 0)) {
705705
#else
706706
if (status >= 0) {
707-
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) */
707+
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5) */
708708
data->samples_count = data->channel_count;
709709
data->buffer += data->channel_count;
710710
/* Stop the DMA engine, only to start it again when the callback returns
@@ -713,9 +713,9 @@ static void dma_callback(const struct device *dev, void *user_data,
713713
* within adc_context_start_sampling
714714
*/
715715
dma_stop(data->dma.dma_dev, data->dma.channel);
716-
#if !defined(CONFIG_SOC_SERIES_STM32F1X)
716+
#if !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5)
717717
LL_ADC_ClearFlag_OVR(adc);
718-
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) */
718+
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5) */
719719
/* No need to invalidate the cache because it's assumed that
720720
* the address is in a non-cacheable SRAM region.
721721
*/
@@ -1005,9 +1005,9 @@ static int start_read(const struct device *dev,
10051005
*/
10061006
adc_stm32_enable(adc);
10071007

1008-
#if !defined(CONFIG_SOC_SERIES_STM32F1X)
1008+
#if !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5)
10091009
LL_ADC_ClearFlag_OVR(adc);
1010-
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) */
1010+
#endif /* !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(STM32F3X_ADC_V2_5) */
10111011

10121012
#if !defined(CONFIG_ADC_STM32_DMA)
10131013
#if defined(CONFIG_SOC_SERIES_STM32F2X) || \

0 commit comments

Comments
 (0)