We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c615907 commit 6e389b5Copy full SHA for 6e389b5
src/usbd.rs
@@ -7,7 +7,6 @@
7
//! * No notification when the status stage is ACK'd.
8
9
use core::cell::Cell;
10
-use core::mem::MaybeUninit;
11
use core::sync::atomic::{compiler_fence, Ordering};
12
use critical_section::{CriticalSection, Mutex};
13
use usb_device::{
@@ -375,12 +374,8 @@ impl<T: UsbPeripheral> UsbBus for Usbd<T> {
375
374
return Err(UsbError::WouldBlock);
376
}
377
378
- let mut ram_buf: MaybeUninit<[u8; 64]> = MaybeUninit::uninit();
379
- unsafe {
380
- let slice = &mut *ram_buf.as_mut_ptr();
381
- slice[..buf.len()].copy_from_slice(buf);
382
- }
383
- let ram_buf = unsafe { ram_buf.assume_init() };
+ let mut ram_buf = [0u8; 64];
+ ram_buf[..buf.len()].copy_from_slice(buf);
384
385
let epin = [
386
®s.epin0,
0 commit comments