diff options
Diffstat (limited to 'scripts/spi_flash')
-rw-r--r-- | scripts/spi_flash/fatfs_lib.py | 6 | ||||
-rw-r--r-- | scripts/spi_flash/spi_flash.py | 42 |
2 files changed, 24 insertions, 24 deletions
diff --git a/scripts/spi_flash/fatfs_lib.py b/scripts/spi_flash/fatfs_lib.py index 6ad37e66..993ce17c 100644 --- a/scripts/spi_flash/fatfs_lib.py +++ b/scripts/spi_flash/fatfs_lib.py @@ -6,12 +6,12 @@ import os import sys -KLIPPER_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) -sys.path.append(os.path.join(KLIPPER_DIR, "klippy")) +KUTTER_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) +sys.path.append(os.path.join(KUTTER_DIR, "klippy")) import chelper DEST_LIB = "fatfs.so" -FATFS_DIR = os.path.join(KLIPPER_DIR, "lib/fatfs") +FATFS_DIR = os.path.join(KUTTER_DIR, "lib/fatfs") FATFS_SRC = ["ff.c", "ffsystem.c", "ffunicode.c"] SPI_FLASH_SRC = ["fatfs_api.c"] FATFS_HEADERS = ["diskio.h", "ff.h", "ffconf.h"] diff --git a/scripts/spi_flash/spi_flash.py b/scripts/spi_flash/spi_flash.py index f784f0a4..b4141cd4 100644 --- a/scripts/spi_flash/spi_flash.py +++ b/scripts/spi_flash/spi_flash.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Module supporting uploads Klipper firmware to an SD Card via SPI and SDIO +# Module supporting uploads firmware to an SD Card via SPI and SDIO # # Copyright (C) 2021 Eric Callahan <arksine.code@gmail.com> # Copyright (C) 2022 H. Gregor Molter <gregor.molter@secretlab.de> @@ -68,7 +68,7 @@ def calc_crc16(data): # Translate a serial device name to a stable serial name in # /dev/serial/by-path/ -# Borrowed from klipper/scripts/flash_usb.py +# Borrowed from kutter/scripts/flash_usb.py def translate_serial_to_tty(device): ttyname = os.path.realpath(device) if os.path.exists("/dev/serial/by-path/"): @@ -83,16 +83,16 @@ def check_need_convert(board_name, config): conv_script = config.get("conversion_script") if conv_script is None: return - conv_util = os.path.join(fatfs_lib.KLIPPER_DIR, conv_script) - klipper_bin = config["klipper_bin_path"] + conv_util = os.path.join(fatfs_lib.KUTTER_DIR, conv_script) + kutter_bin = config["kutter_bin_path"] dest_bin = os.path.join( - os.path.dirname(klipper_bin), os.path.basename(config["firmware_path"]) + os.path.dirname(kutter_bin), os.path.basename(config["firmware_path"]) ) - cmd = "%s %s %s %s" % (sys.executable, conv_util, klipper_bin, dest_bin) - output("Converting Klipper binary to custom format...") + cmd = "%s %s %s %s" % (sys.executable, conv_util, kutter_bin, dest_bin) + output("Converting Kutter binary to custom format...") os.system(cmd) output_line("Done") - config["klipper_bin_path"] = dest_bin + config["kutter_bin_path"] = dest_bin ########################################################### @@ -1469,13 +1469,13 @@ class MCUConnection: raise SPIFlashError("Unknown bus defined in board_defs.py.") def sdcard_upload(self): - output("Uploading Klipper Firmware to SD Card...") + output("Uploading Kutter Firmware to SD Card...") input_sha = hashlib.sha1() sd_sha = hashlib.sha1() - klipper_bin_path = self.board_config["klipper_bin_path"] + kutter_bin_path = self.board_config["kutter_bin_path"] fw_path = self.board_config.get("firmware_path", "firmware.bin") try: - with open(klipper_bin_path, "rb") as local_f: + with open(kutter_bin_path, "rb") as local_f: with self.fatfs.open_file(fw_path, "wb") as sd_f: while True: buf = local_f.read(4096) @@ -1586,9 +1586,9 @@ class SPIFlash: self.board_config = args if not os.path.exists(args["device"]): raise SPIFlashError("No device found at '%s'" % (args["device"],)) - if not os.path.isfile(args["klipper_bin_path"]): + if not os.path.isfile(args["kutter_bin_path"]): raise SPIFlashError( - "Unable to locate klipper binary at '%s'" % (args["klipper_bin_path"],) + "Unable to locate Kutter binary at '%s'" % (args["kutter_bin_path"],) ) tty_name, dev_by_path = translate_serial_to_tty(args["device"]) self.device_path = dev_by_path @@ -1600,14 +1600,14 @@ class SPIFlash: self.need_verify = True self.old_dictionary = None self.new_dictionary = None - if args["klipper_dict_path"] is not None: + if args["kutter_dict_path"] is not None: try: - with open(args["klipper_dict_path"], "rb") as dict_f: + with open(args["kutter_dict_path"], "rb") as dict_f: self.new_dictionary = dict_f.read(32 * 1024) except Exception: raise SPIFlashError( "Missing or invalid dictionary at '%s'" - % (args["klipper_dict_path"],) + % (args["kutter_dict_path"],) ) def _wait_for_reconnect(self): @@ -1738,10 +1738,10 @@ def main(): parser.add_argument( "-d", "--dict_path", - metavar="<klipper.dict>", + metavar="<kutter.dict>", type=str, default=None, - help="Klipper firmware dictionary", + help="Kutter firmware dictionary", ) parser.add_argument( "-c", "--check", action="store_true", help="Perform flash check/verify only" @@ -1749,7 +1749,7 @@ def main(): parser.add_argument("device", metavar="<device>", help="Device Serial Port") parser.add_argument("board", metavar="<board>", help="Board Type") parser.add_argument( - "klipper_bin_path", metavar="<klipper.bin>", help="Klipper firmware binary" + "kutter_bin_path", metavar="<kutter.bin>", help="Kutter firmware binary" ) args = parser.parse_args() log_level = logging.DEBUG if args.verbose else logging.CRITICAL @@ -1760,8 +1760,8 @@ def main(): sys.exit(-1) flash_args["device"] = args.device flash_args["baud"] = args.baud - flash_args["klipper_bin_path"] = args.klipper_bin_path - flash_args["klipper_dict_path"] = args.dict_path + flash_args["kutter_bin_path"] = args.kutter_bin_path + flash_args["kutter_dict_path"] = args.dict_path flash_args["verify_only"] = args.check if args.check: # override board_defs setting when doing verify-only: |