mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
flashtool: fix mcu_type decoding
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
28b873de75
commit
604b7e5a7d
@ -283,7 +283,7 @@ class CanFlasher:
|
|||||||
proto_version_str = ".".join([str(v) for v in self.proto_version])
|
proto_version_str = ".".join([str(v) for v in self.proto_version])
|
||||||
if self.block_size not in [64, 128, 256, 512]:
|
if self.block_size not in [64, 128, 256, 512]:
|
||||||
raise FlashError("Invalid Block Size: %d" % (self.block_size,))
|
raise FlashError("Invalid Block Size: %d" % (self.block_size,))
|
||||||
mcu_info.rstrip(b"\x00")
|
mcu_info = mcu_info.rstrip(b"\x00")
|
||||||
if self.proto_version >= (1, 1, 0):
|
if self.proto_version >= (1, 1, 0):
|
||||||
mcu_bytes, sv_bytes = mcu_info.split(b"\x00", maxsplit=1)
|
mcu_bytes, sv_bytes = mcu_info.split(b"\x00", maxsplit=1)
|
||||||
mcu_type = mcu_bytes.decode()
|
mcu_type = mcu_bytes.decode()
|
||||||
@ -302,7 +302,7 @@ class CanFlasher:
|
|||||||
bin_mcu = self.klipper_dict.get("config", {}).get("MCU", "")
|
bin_mcu = self.klipper_dict.get("config", {}).get("MCU", "")
|
||||||
if bin_mcu and bin_mcu != mcu_type:
|
if bin_mcu and bin_mcu != mcu_type:
|
||||||
raise FlashError(
|
raise FlashError(
|
||||||
"MCU returned by Katapult does not match MCU"
|
"MCU returned by Katapult does not match MCU "
|
||||||
"identified in klipper.bin.\n"
|
"identified in klipper.bin.\n"
|
||||||
f"Katapult MCU: {mcu_type}\n"
|
f"Katapult MCU: {mcu_type}\n"
|
||||||
f"Klipper Binary MCU: {bin_mcu}"
|
f"Klipper Binary MCU: {bin_mcu}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user