mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-08 07:27:43 -06:00
scripts: support CanBoot on RP2040 in flash_usb.py
Signed-off-by: Chris Lee <clee@mg8.org>
This commit is contained in:
parent
f078a27905
commit
aac613bf44
2 changed files with 10 additions and 5 deletions
|
@ -193,6 +193,7 @@ def call_picoboot(bus, addr, binfile, sudo):
|
|||
|
||||
# Flash via Klipper modified "picoboot"
|
||||
def flash_picoboot(device, binfile, sudo):
|
||||
ttyname, serbypath = translate_serial_to_tty(device)
|
||||
buspath, devpath = translate_serial_to_usb_path(device)
|
||||
# We need one level up to get access to busnum/devnum files
|
||||
usbdir = os.path.dirname(devpath)
|
||||
|
@ -202,7 +203,10 @@ def flash_picoboot(device, binfile, sudo):
|
|||
bus = f.read().strip()
|
||||
with open(usbdir + "/devnum") as f:
|
||||
addr = f.read().strip()
|
||||
call_picoboot(bus, addr, binfile, sudo)
|
||||
if detect_canboot(devpath):
|
||||
call_flashcan(serbypath, binfile)
|
||||
else:
|
||||
call_picoboot(bus, addr, binfile, sudo)
|
||||
|
||||
|
||||
######################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue