diff options
| author | Fabian Wolter <[email protected]> | 2024-12-30 20:46:56 +0100 |
|---|---|---|
| committer | Fabian Wolter <[email protected]> | 2024-12-30 20:46:56 +0100 |
| commit | 306a7812672f47aa327e79c854992f90ac7fdb25 (patch) | |
| tree | 56413becf1692a4532c487265acc75dcbd887868 | |
| parent | 9e34058c2b657ed0499ca16966c2326bbc77079c (diff) | |
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)); |
