tools/pydfu.py: Display any error strings from device/mboot.

pull/5784/head
Andrew Leech 2020-03-05 15:00:07 +11:00 zatwierdzone przez Damien George
rodzic f7130a99b6
commit 38ccb4c643
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -161,6 +161,13 @@ def clr_status():
def get_status():
"""Get the status of the last operation."""
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]