From 28c2521926403c51ec588706e4eb708da8d51cd3 Mon Sep 17 00:00:00 2001 From: John Bason Mitchell Date: Fri, 25 Apr 2025 18:27:33 +0100 Subject: [PATCH] drivers: adc: disabling timer after DMA eror The ADC timer should be disabled however the read is finished. Signed-off-by: John Bason Mitchell --- drivers/adc/adc_stm32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index fd800823470..34d871509ba 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -819,6 +819,9 @@ static void dma_callback(const struct device *dev, void *user_data, LL_ADC_REG_StopConversion(adc); #endif dma_stop(data->dma.dma_dev, data->dma.channel); + if (data->ctx.options.interval_us != 0U) { + adc_context_disable_timer(&data->ctx); + } adc_context_complete(&data->ctx, status); } }