From aa2fa29b89c120ec23d64252d3f1b036c1369b00 Mon Sep 17 00:00:00 2001 From: xoviat Date: Fri, 15 Sep 2023 17:36:21 -0500 Subject: [PATCH] stm32: fix adc f3 startup time closes #1888. --- embassy-stm32/src/adc/f3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embassy-stm32/src/adc/f3.rs b/embassy-stm32/src/adc/f3.rs index 2971ad527..b39d6ac8e 100644 --- a/embassy-stm32/src/adc/f3.rs +++ b/embassy-stm32/src/adc/f3.rs @@ -50,7 +50,7 @@ impl<'d, T: Instance> Adc<'d, T> { while T::regs().cr().read().adcal() {} // Wait more than 4 clock cycles after adcal is cleared (RM0364 p. 223) - delay.delay_us(6 * 1_000_000 / Self::freq().0); + delay.delay_us(1 + (6 * 1_000_000 / Self::freq().0)); // Enable the adc T::regs().cr().modify(|w| w.set_aden(true));