mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 21:01:06 +00:00
Merge pull request #3700 from fwolter/usb-delay
STM32: set USB initialization delay to 1µs
This commit is contained in:
commit
667dfa34b5
@ -305,10 +305,8 @@ impl<'d, T: Instance> Driver<'d, T> {
|
||||
w.set_fres(true);
|
||||
});
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
embassy_time::block_for(embassy_time::Duration::from_millis(100));
|
||||
#[cfg(not(feature = "time"))]
|
||||
cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 10);
|
||||
// wait t_STARTUP = 1us
|
||||
cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 1_000_000);
|
||||
|
||||
#[cfg(not(usb_v4))]
|
||||
regs.btable().write(|w| w.set_btable(0));
|
||||
|
Loading…
x
Reference in New Issue
Block a user