drivers: adc: stm32: reset acquisition time between reads
For all STM32 ADC that use common sampling times, there is a check made to ensure that all channels of a sequence use the same sampling time. The value was not reset between reads, resulting in error if two consecutive sequences used different values. This commit adds a reset of this value once read is done. Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This commit is contained in:
parent
5656c23243
commit
e8e5d5554c
1 changed files with 6 additions and 0 deletions
|
@ -990,6 +990,11 @@ static void adc_context_on_complete(struct adc_context *ctx, int status)
|
|||
ARG_UNUSED(status);
|
||||
|
||||
adc_stm32_disable(adc);
|
||||
|
||||
/* Reset acquisition time used for the sequence */
|
||||
data->acq_time_index = -1;
|
||||
|
||||
/* Reset internal channels */
|
||||
LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(adc),
|
||||
LL_ADC_PATH_INTERNAL_NONE);
|
||||
|
||||
|
@ -1119,6 +1124,7 @@ static int adc_stm32_channel_setup(const struct device *dev,
|
|||
* identical acquisition time.
|
||||
*/
|
||||
if (acq_time_index != data->acq_time_index) {
|
||||
LOG_ERR("Multiple sampling times not supported");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue