diff options
| author | xoviat <[email protected]> | 2023-09-11 17:27:47 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-09-11 17:27:47 -0500 |
| commit | 44a5c32ea460a7fb1c125b0f487bc1d705f077e1 (patch) | |
| tree | 50b8de7cca0ea04d5cf7dd3bd23bdb94ea9ca53f | |
| parent | b9889ad3b568b54b029422a039b7e9bf73b60a39 (diff) | |
adc/f3: fix startup bug
| -rw-r--r-- | embassy-stm32/src/adc/f3.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/embassy-stm32/src/adc/f3.rs b/embassy-stm32/src/adc/f3.rs index 8f16c6abf..c7b876fe1 100644 --- a/embassy-stm32/src/adc/f3.rs +++ b/embassy-stm32/src/adc/f3.rs | |||
| @@ -49,6 +49,9 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 49 | 49 | ||
| 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) | ||
| 53 | delay.delay_us(6 * Self::freq().0 / 1_000_000); | ||
| 54 | |||
| 52 | // Enable the adc | 55 | // Enable the adc |
| 53 | T::regs().cr().modify(|w| w.set_aden(true)); | 56 | T::regs().cr().modify(|w| w.set_aden(true)); |
| 54 | 57 | ||
