From fc8a6aa7a2dc1009f762a5c2c5711863a50a8f79 Mon Sep 17 00:00:00 2001 From: M J Oldfield Date: Sat, 27 Apr 2019 22:21:56 +0100 Subject: [PATCH] stm32: adc-v2: set _only_ the ADC calibration bit In adc_calibrate_async() we should only set the ADCAL bit and leave the rest alone. While in the past there were only "rs" bits in this register, this is no longer the case. Reviewed-by: Karl Palsson --- lib/stm32/common/adc_common_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stm32/common/adc_common_v2.c b/lib/stm32/common/adc_common_v2.c index 5ad85c6a..7fd26476 100644 --- a/lib/stm32/common/adc_common_v2.c +++ b/lib/stm32/common/adc_common_v2.c @@ -155,7 +155,7 @@ void adc_power_off(uint32_t adc) */ void adc_calibrate_async(uint32_t adc) { - ADC_CR(adc) = ADC_CR_ADCAL; + ADC_CR(adc) |= ADC_CR_ADCAL; } /**