drivers: adc_stm32: Get clock frequency from DTS
The adc_stm32 driver used system timer frequency as a base for busy-wait delay calculation. This commit corrects that by obtaining the needed value from SystemCoreClock variable. Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
parent
a901e32a38
commit
70d61cdd55
1 changed files with 1 additions and 1 deletions
|
@ -557,7 +557,7 @@ static int adc_stm32_init(struct device *dev)
|
|||
LOG_ERR("ADC clock rate get error.");
|
||||
}
|
||||
|
||||
wait_cycles = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / adc_rate *
|
||||
wait_cycles = SystemCoreClock / adc_rate *
|
||||
LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES;
|
||||
|
||||
for (int i = wait_cycles; i >= 0; i--) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue