Merge pull request #1887 from xoviat/adc

adc/f3: fix delay calculation
This commit is contained in:
xoviat 2023-09-11 23:54:26 +00:00 committed by GitHub
commit 2c38dd17b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 * Self::freq().0 / 1_000_000);
delay.delay_us(6 * 1_000_000 / Self::freq().0);
// Enable the adc
T::regs().cr().modify(|w| w.set_aden(true));