Browse Source

drivers: adc: stm32: Fix sequence configuration

The STM32 driver currently does not support reading a sequence of
multiple ADC channels. Only the first channel of the sequence was
read and the rest was silently ignored.

Fix: Return an error if reading multiple channels is requested.

Signed-off-by: Martin Jäger <martin@libre.solar>
pull/31558/head
Martin Jäger 5 years ago committed by Anas Nashif
parent
commit
3c7b2771b1
  1. 4
      drivers/adc/adc_stm32.c

4
drivers/adc/adc_stm32.c

@ -319,6 +319,10 @@ static int start_read(const struct device *dev, @@ -319,6 +319,10 @@ static int start_read(const struct device *dev,
}
uint32_t channels = sequence->channels;
if (channels > find_lsb_set(channels)) {
LOG_ERR("Only single channel supported");
return -ENOTSUP;
}
data->buffer = sequence->buffer;
uint8_t index;

Loading…
Cancel
Save