diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-12-31 11:34:14 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-31 11:34:14 +0100 |
| commit | 667dfa34b525f727936d621ba91001fa25d80426 (patch) | |
| tree | 1053ae77ad9998a4545e2967c0d1a679fa086d6b | |
| parent | 29dce03adc40099105f0c4b430be5c1f413b1a52 (diff) | |
| parent | 306a7812672f47aa327e79c854992f90ac7fdb25 (diff) | |
Merge pull request #3700 from fwolter/usb-delay
STM32: set USB initialization delay to 1µs
| -rw-r--r-- | embassy-stm32/src/usb/usb.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 94af00b6e..8be051968 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -305,10 +305,8 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 305 | w.set_fres(true); | 305 | w.set_fres(true); |
| 306 | }); | 306 | }); |
| 307 | 307 | ||
| 308 | #[cfg(feature = "time")] | 308 | // wait t_STARTUP = 1us |
| 309 | embassy_time::block_for(embassy_time::Duration::from_millis(100)); | 309 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 1_000_000); |
| 310 | #[cfg(not(feature = "time"))] | ||
| 311 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 10); | ||
| 312 | 310 | ||
| 313 | #[cfg(not(usb_v4))] | 311 | #[cfg(not(usb_v4))] |
| 314 | regs.btable().write(|w| w.set_btable(0)); | 312 | regs.btable().write(|w| w.set_btable(0)); |
