367 self.tr("Flash MicroPython Firmware"), |
367 self.tr("Flash MicroPython Firmware"), |
368 downloadsPath, |
368 downloadsPath, |
369 self.tr("MicroPython Firmware Files (*.hex *.bin);; All Files (*)"), |
369 self.tr("MicroPython Firmware Files (*.hex *.bin);; All Files (*)"), |
370 ) |
370 ) |
371 if firmware and os.path.exists(firmware): |
371 if firmware and os.path.exists(firmware): |
372 args = [ |
372 args = ["--connect-under-reset"] |
373 "--connect-under-reset" |
|
374 ] |
|
375 if os.path.splitext(firmware)[-1].lower() == ".hex": |
373 if os.path.splitext(firmware)[-1].lower() == ".hex": |
376 args.extend(["--format", "ihex", "write", firmware]) |
374 args.extend(["--format", "ihex", "write", firmware]) |
377 else: |
375 else: |
378 args.extend(["write", firmware, "0x08000000"]) |
376 args.extend(["write", firmware, "0x08000000"]) |
379 dlg = EricProcessDialog( |
377 dlg = EricProcessDialog( |