From 306a7812672f47aa327e79c854992f90ac7fdb25 Mon Sep 17 00:00:00 2001 From: Fabian Wolter Date: Mon, 30 Dec 2024 20:46:56 +0100 Subject: [PATCH] =?UTF-8?q?STM32:=20set=20USB=20initialization=20delay=20t?= =?UTF-8?q?o=201=C2=B5s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- embassy-stm32/src/usb/usb.rs | 6 ++---- 1 file 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> { 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));