Merge pull request #3992 from elagil/usb_fixes

Small USB-related fixes
This commit is contained in:
Dario Nieuwenhuis 2025-03-25 11:03:53 +00:00 committed by GitHub
commit 17cce79807
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -887,6 +887,16 @@ impl<'d, T: Instance> driver::EndpointOut for Endpoint<'d, T, Out> {
})
.await;
// Errata for STM32H5, 2.20.1:
// During OUT transfers, the correct transfer interrupt (CTR) is triggered a little before the last USB SRAM accesses
// have completed. If the software responds quickly to the interrupt, the full buffer contents may not be correct.
//
// Workaround:
// 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));
RX_COMPLETE[index].store(false, Ordering::Relaxed);
if stat == Stat::DISABLED {

View File

@ -348,7 +348,7 @@ pub struct AudioSettings {
impl Default for AudioSettings {
fn default() -> Self {
AudioSettings {
muted: [true; MAX_AUDIO_CHANNEL_COUNT],
muted: [false; MAX_AUDIO_CHANNEL_COUNT],
volume_8q8_db: [MAX_VOLUME_DB * VOLUME_STEPS_PER_DB; MAX_AUDIO_CHANNEL_COUNT],
}
}