Skip to content

Commit 72fa1e0

Browse files
authored
Merge pull request #8119 from jeromecoutant/PR_L4_ADC
STM32L496 : wrong ADC init
2 parents 9d39f23 + 2a70879 commit 72fa1e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

targets/TARGET_STM/TARGET_STM32L4/analogin_device.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ void analogin_init(analogin_t *obj, PinName pin)
8282
obj->handle.Init.DMAContinuousRequests = DISABLE;
8383
obj->handle.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; // DR register is overwritten with the last conversion result in case of overrun
8484
obj->handle.Init.OversamplingMode = DISABLE; // No oversampling
85+
#if defined(ADC_CFGR_DFSDMCFG) &&defined(DFSDM1_Channel0)
86+
obj->handle.Init.DFSDMConfig = 0;
87+
#endif
8588

8689
// Enable ADC clock
8790
__HAL_RCC_ADC_CLK_ENABLE();

0 commit comments

Comments
 (0)