Skip to content

Commit

Permalink
Fix reboot to bootloader on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzz committed Mar 19, 2020
1 parent a044243 commit 6e25b66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ def cmd_flash(dev, offset, firmware, progress_cb=console_progress, complete_cb=c

def cmd_reboot(dev, progress_cb=console_progress, complete_cb=console_complete, error_cb=console_error):
progress_cb("Reboot to bootloader", 0)
data = b"\x00" + struct.pack("<II", 0x5AA555AA, 0xCC3300FF)
data += b"\x00" * (64 - len(data))
print(dev.send_feature_report(data))
hid_set_feature(dev, struct.pack("<II", 0x5AA555AA, 0xCC3300FF))
progress_cb("Reboot to bootloader", 0.5)
time.sleep(5)
complete_cb()
Expand Down Expand Up @@ -235,7 +233,8 @@ def on_click_refresh(self):
for dev in hid.enumerate():
vid, pid = dev["vendor_id"], dev["product_id"]
if (vid, pid) in DEVICE_DESC:
self.combobox_devices.addItem("{} [{:04X}:{:04X}:{:02X}]".format(DEVICE_DESC[(vid, pid)], vid, pid, dev["interface_number"]))
self.combobox_devices.addItem("{} [{:04X}:{:04X}:{:02X}:{:02X}]".format(DEVICE_DESC[(vid, pid)], vid, pid,
dev["interface_number"], dev["usage"]))
self.devices.append(dev)

def get_active_device(self):
Expand Down

0 comments on commit 6e25b66

Please sign in to comment.