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>
This commit is contained in:
Martin Jäger 2020-06-18 15:46:33 +02:00 committed by Anas Nashif
commit 3c7b2771b1

View file

@ -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;