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:
parent
6055f25b13
commit
3c7b2771b1
1 changed files with 4 additions and 0 deletions
|
@ -319,6 +319,10 @@ static int start_read(const struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t channels = sequence->channels;
|
uint32_t channels = sequence->channels;
|
||||||
|
if (channels > find_lsb_set(channels)) {
|
||||||
|
LOG_ERR("Only single channel supported");
|
||||||
|
return -ENOTSUP;
|
||||||
|
}
|
||||||
|
|
||||||
data->buffer = sequence->buffer;
|
data->buffer = sequence->buffer;
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue