usb-device: Raise RuntimeError when DCD error occurs.

So the behavior matches the comment.

Signed-off-by: Hyx <hyx0329@outlook.com>
pull/1035/head
Hyx 2025-08-01 12:47:43 +08:00 zatwierdzone przez Damien George
rodzic 34c4ee1647
commit ea763cad8d
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -1,2 +1,2 @@
metadata(version="0.2.0")
metadata(version="0.2.1")
package("usb")

Wyświetl plik

@ -600,7 +600,8 @@ class Interface:
# function has returned to the caller.
if not self._open:
raise RuntimeError("Not open")
_dev._submit_xfer(ep_addr, data, done_cb)
if not _dev._submit_xfer(ep_addr, data, done_cb):
raise RuntimeError("DCD error")
def stall(self, ep_addr, *args):
# Set or get the endpoint STALL state.