Skip to content

Commit 056a0b0

Browse files
committed
Don't prepare DMA transfers in reset
1 parent 9a366d9 commit 056a0b0

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

mod.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -329,52 +329,7 @@ impl UsbBus for Usbd<'_> {
329329
interrupt::free(|cs| {
330330
let regs = self.periph.borrow(cs);
331331

332-
// Neat little hack to work around svd2rust not coalescing these on its own.
333-
let epin = [
334-
&regs.epin0,
335-
&regs.epin1,
336-
&regs.epin2,
337-
&regs.epin3,
338-
&regs.epin4,
339-
&regs.epin5,
340-
&regs.epin6,
341-
&regs.epin7,
342-
];
343-
let epout = [
344-
&regs.epout0,
345-
&regs.epout1,
346-
&regs.epout2,
347-
&regs.epout3,
348-
&regs.epout4,
349-
&regs.epout5,
350-
&regs.epout6,
351-
&regs.epout7,
352-
];
353-
354332
// TODO: Initialize ISO buffers
355-
// Initialize all data pointers for the endpoint buffers, since they never change.
356-
for i in 0..8 {
357-
let in_enabled = self.used_in & (1 << i) != 0;
358-
let out_enabled = self.used_out & (1 << i) != 0;
359-
360-
if in_enabled {
361-
unsafe {
362-
epin[i].ptr.write(|w| w.bits(self.bufs.in_bufs[i] as u32));
363-
epin[i]
364-
.maxcnt
365-
.write(|w| w.bits(u32::from(self.bufs.in_lens[i])));
366-
}
367-
}
368-
369-
if out_enabled {
370-
unsafe {
371-
epout[i].ptr.write(|w| w.bits(self.bufs.out_bufs[i] as u32));
372-
epout[i]
373-
.maxcnt
374-
.write(|w| w.bits(u32::from(self.bufs.out_lens[i])));
375-
}
376-
}
377-
}
378333

379334
// XXX this is not spec compliant; the endpoints should only be enabled after the device
380335
// has been put in the Configured state. However, usb-device provides no hook to do that

0 commit comments

Comments
 (0)