mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 00:50:24 +08:00
tools/pydfu.py: Display any error strings from device/mboot.
This commit is contained in:
parent
f7130a99b6
commit
38ccb4c643
@ -161,6 +161,13 @@ def clr_status():
|
|||||||
def get_status():
|
def get_status():
|
||||||
"""Get the status of the last operation."""
|
"""Get the status of the last operation."""
|
||||||
stat = __dev.ctrl_transfer(0xA1, __DFU_GETSTATUS, 0, __DFU_INTERFACE, 6, 20000)
|
stat = __dev.ctrl_transfer(0xA1, __DFU_GETSTATUS, 0, __DFU_INTERFACE, 6, 20000)
|
||||||
|
|
||||||
|
# firmware can provide an optional string for any error
|
||||||
|
if stat[5]:
|
||||||
|
message = get_string(__dev, stat[5])
|
||||||
|
if message:
|
||||||
|
print(message)
|
||||||
|
|
||||||
return stat[4]
|
return stat[4]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user