Skip to content

Commit 685160a

Browse files
committed
usb: Raise RuntimeError when DCD error occurs.
So the behavior matches the comment. Signed-off-by: Hyx <[email protected]>
1 parent f95568d commit 685160a

File tree

1 file changed

+2
-1
lines changed
  • micropython/usb/usb-device/usb/device

1 file changed

+2
-1
lines changed

micropython/usb/usb-device/usb/device/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ def submit_xfer(self, ep_addr, data, done_cb=None):
600600
# function has returned to the caller.
601601
if not self._open:
602602
raise RuntimeError("Not open")
603-
_dev._submit_xfer(ep_addr, data, done_cb)
603+
if not _dev._submit_xfer(ep_addr, data, done_cb):
604+
raise RuntimeError("DCD error")
604605

605606
def stall(self, ep_addr, *args):
606607
# Set or get the endpoint STALL state.

0 commit comments

Comments
 (0)