diff options
| author | xoviat <[email protected]> | 2023-09-11 23:54:26 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-11 23:54:26 +0000 |
| commit | 2c38dd17b9a5a507fc77d90d78486e4764234752 (patch) | |
| tree | 586b620f353d0fdc340dc97b488c295d78f4ad30 | |
| parent | e11db9fa5934882dbf332aaacb676bbe370c1aa1 (diff) | |
| parent | d36e7abb71bb95907e69bd32359b21b44fe2150b (diff) | |
Merge pull request #1887 from xoviat/adc
adc/f3: fix delay calculation
| -rw-r--r-- | embassy-stm32/src/adc/f3.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-stm32/src/adc/f3.rs b/embassy-stm32/src/adc/f3.rs index c7b876fe1..2971ad527 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> { | |||
| 50 | while T::regs().cr().read().adcal() {} | 50 | while T::regs().cr().read().adcal() {} |
| 51 | 51 | ||
| 52 | // Wait more than 4 clock cycles after adcal is cleared (RM0364 p. 223) | 52 | // Wait more than 4 clock cycles after adcal is cleared (RM0364 p. 223) |
| 53 | delay.delay_us(6 * Self::freq().0 / 1_000_000); | 53 | delay.delay_us(6 * 1_000_000 / Self::freq().0); |
| 54 | 54 | ||
| 55 | // Enable the adc | 55 | // Enable the adc |
| 56 | T::regs().cr().modify(|w| w.set_aden(true)); | 56 | T::regs().cr().modify(|w| w.set_aden(true)); |
