diff options
author | Chris Lee <clee@mg8.org> | 2022-12-19 12:30:12 -0700 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2022-12-19 15:42:53 -0500 |
commit | aac613bf44ca1feb4334ab35378b48711baccb60 (patch) | |
tree | 899dc2ec85b6a209a3a950bf1983987ae8a60e8a /scripts/flash_usb.py | |
parent | f078a279059670e692ea676237b152b4d42518e4 (diff) | |
download | kutter-aac613bf44ca1feb4334ab35378b48711baccb60.tar.gz kutter-aac613bf44ca1feb4334ab35378b48711baccb60.tar.xz kutter-aac613bf44ca1feb4334ab35378b48711baccb60.zip |
scripts: support CanBoot on RP2040 in flash_usb.py
Signed-off-by: Chris Lee <clee@mg8.org>
Diffstat (limited to 'scripts/flash_usb.py')
-rwxr-xr-x | scripts/flash_usb.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/flash_usb.py b/scripts/flash_usb.py index 83422f91..e43c457c 100755 --- a/scripts/flash_usb.py +++ b/scripts/flash_usb.py @@ -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) ###################################################################### |