Various fixes (#102)

This commit is contained in:
Yaya-Cout
2021-12-17 19:12:24 +01:00
committed by GitHub
parent 139ef4a052
commit cd3f5225bb
4 changed files with 12 additions and 2 deletions

View File

@@ -148,7 +148,12 @@ def abort_request():
def unlock_request():
"""Deactivate the protection"""
__dev.ctrl_transfer(0x21, __DFU_UNLOCK, 0, __DFU_INTERFACE, None, __TIMEOUT)
try:
__dev.ctrl_transfer(0x21, __DFU_UNLOCK, 0, __DFU_INTERFACE, None,
__TIMEOUT)
except usb.core.USBError:
print("Error when disabling protection, ignoring", file=sys.stderr)
def clr_status():
"""Clears any error status (perhaps left over from a previous session)."""