drivers: adc: stm32: Use k_usleep variant

Convert these k_sleep calls to use the k_usleep instead.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2022-07-27 22:07:11 +08:00 committed by Carles Cufí
parent d4205f46dd
commit 36a73d7704

View file

@ -537,14 +537,14 @@ static void adc_stm32_setup_channels(const struct device *dev, uint8_t channel_i
if ((__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_TEMPSENSOR_ADC1) == channel_id)
&& (config->base == ADC1)) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_TEMPSENSOR);
k_sleep(K_USEC(LL_ADC_DELAY_TEMPSENSOR_STAB_US));
k_usleep(LL_ADC_DELAY_TEMPSENSOR_STAB_US);
}
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc5), okay)
if ((__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_TEMPSENSOR_ADC5) == channel_id)
&& (config->base == ADC5)) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_TEMPSENSOR);
k_sleep(K_USEC(LL_ADC_DELAY_TEMPSENSOR_STAB_US));
k_usleep(LL_ADC_DELAY_TEMPSENSOR_STAB_US);
}
#endif
}
@ -553,7 +553,7 @@ static void adc_stm32_setup_channels(const struct device *dev, uint8_t channel_i
__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_TEMPSENSOR) == channel_id) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_TEMPSENSOR);
#ifdef LL_ADC_DELAY_TEMPSENSOR_STAB_US
k_sleep(K_USEC(LL_ADC_DELAY_TEMPSENSOR_STAB_US));
k_usleep(LL_ADC_DELAY_TEMPSENSOR_STAB_US);
#endif
}
#endif /* CONFIG_SOC_SERIES_STM32G4X */
@ -562,7 +562,7 @@ static void adc_stm32_setup_channels(const struct device *dev, uint8_t channel_i
__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_VREFINT) == channel_id) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_VREFINT);
#ifdef LL_ADC_DELAY_VREFINT_STAB_US
k_sleep(K_USEC(LL_ADC_DELAY_VREFINT_STAB_US));
k_usleep(LL_ADC_DELAY_VREFINT_STAB_US);
#endif
}
#if defined(LL_ADC_CHANNEL_VBAT)