-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Describe the bug
The macro ADC_ACQ_TIME is used in adc_stm32.c, adc_stm32_sampling_time_check() to pick the index of sampling_time_table:
for (int i = 0; i < STM32_NB_SAMPLING_TIME; i++) { if (acq_time == ADC_ACQ_TIME(ADC_ACQ_TIME_TICKS, config->sampling_time_table[i])) { return i; }
This is useful for setting the "zephyr,acquisition-time" property but not for retrieving the value at an index
Using the raw value at current index of sampling_time_table leads to picking the correct index:
for (int i = 0; i < STM32_NB_SAMPLING_TIME; i++) { if (acq_time == config->sampling_time_table[i]) { return i; } }
Regression
- This is a regression.
Steps to reproduce
Use adc_stm32.c, adc_stm32_sampling_time_check(const struct device *dev, uint16_t acq_time) with any parameter.
Relevant log output
Impact
Functional Limitation – Some features not working as expected, but system usable.
Environment
- Zephyr 4.1
Additional Context
No response