mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-27 20:30:29 +00:00
fix: stm32/usb: Fixed STM32H5 build requiring time feature
A busy loop has been added for when the "time" feature is not enabled.
This commit is contained in:
parent
f86cf87f2f
commit
fb8757c690
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
<!-- next-header -->
|
||||
## Unreleased - ReleaseDate
|
||||
|
||||
- fix: Fixed STM32H5 builds requiring time feature
|
||||
|
||||
## 0.4.0 - 2025-08-26
|
||||
|
||||
- feat: stm32/sai: make NODIV independent of MCKDIV
|
||||
|
@ -912,7 +912,16 @@ impl<'d, T: Instance> driver::EndpointOut for Endpoint<'d, T, Out> {
|
||||
// Software should ensure that a small delay is included before accessing the SRAM contents. This delay should be
|
||||
// 800 ns in Full Speed mode and 6.4 μs in Low Speed mode.
|
||||
#[cfg(stm32h5)]
|
||||
embassy_time::block_for(embassy_time::Duration::from_nanos(800));
|
||||
{
|
||||
#[cfg(feature = "time")]
|
||||
embassy_time::block_for(embassy_time::Duration::from_nanos(800));
|
||||
#[cfg(not(feature = "time"))]
|
||||
{
|
||||
let freq = unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 as u64;
|
||||
let cycles = freq * 800 / 1_000_000;
|
||||
cortex_m::asm::delay(cycles as u32);
|
||||
}
|
||||
}
|
||||
|
||||
RX_COMPLETE[index].store(false, Ordering::Relaxed);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user