From 0afe05388e11a5852ab4e9e156919c6b92c98908 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Thu, 13 Sep 2018 11:43:43 +0200 Subject: [PATCH] STM32L496 : wrong ADC init --- targets/TARGET_STM/TARGET_STM32L4/analogin_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c b/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c index e545581489..453b3d564a 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c @@ -82,6 +82,9 @@ void analogin_init(analogin_t *obj, PinName pin) obj->handle.Init.DMAContinuousRequests = DISABLE; obj->handle.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; // DR register is overwritten with the last conversion result in case of overrun obj->handle.Init.OversamplingMode = DISABLE; // No oversampling +#if defined(ADC_CFGR_DFSDMCFG) &&defined(DFSDM1_Channel0) + obj->handle.Init.DFSDMConfig = 0; +#endif // Enable ADC clock __HAL_RCC_ADC_CLK_ENABLE();