Skip to content

Commit ff34267

Browse files
committed
drivers/adc/adc_stm32: Check both single-ended and differential defines
The stm32u3x header files defines LL_ADC_SINGLE_ENDED but not LL_ADC_DIFFERENTIAL as the device doesn't support differential mode. The driver only checked for LL_ADC_SINGLE_ENDED and assumed that when that was defined, LL_ADC_DIFFERENTIAL would also be defined. Check for both when figuring out which calibration type will be required. Signed-off-by: Keith Packard <[email protected]>
1 parent af2ccb0 commit ff34267

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/adc/adc_stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ static void adc_stm32_calibration_start(const struct device *dev, bool single_en
498498
const struct adc_stm32_cfg *config =
499499
(const struct adc_stm32_cfg *)dev->config;
500500
ADC_TypeDef *adc = config->base;
501-
#ifdef LL_ADC_SINGLE_ENDED
501+
#if defined(LL_ADC_SINGLE_ENDED) && defined(LL_ADC_DIFFERENTIAL_ENDED)
502502
uint32_t calib_type = single_ended ? LL_ADC_SINGLE_ENDED : LL_ADC_DIFFERENTIAL_ENDED;
503503
#else
504504
ARG_UNUSED(single_ended);

0 commit comments

Comments
 (0)