mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 00:03:42 +05:00
fix: ignore flash method when checking for firmware files
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -20,17 +20,16 @@ from utils.logger import Logger
|
|||||||
from utils.system_utils import log_process
|
from utils.system_utils import log_process
|
||||||
|
|
||||||
|
|
||||||
def find_firmware_file(method: FlashMethod) -> bool:
|
def find_firmware_file() -> bool:
|
||||||
target = KLIPPER_DIR.joinpath("out")
|
target = KLIPPER_DIR.joinpath("out")
|
||||||
target_exists = target.exists()
|
target_exists = target.exists()
|
||||||
if method is FlashMethod.REGULAR:
|
|
||||||
f1 = "klipper.elf.hex"
|
f1 = "klipper.elf.hex"
|
||||||
f2 = "klipper.elf"
|
f2 = "klipper.elf"
|
||||||
fw_file_exists = target.joinpath(f1).exists() and target.joinpath(f2).exists()
|
f3 = "klipper.bin"
|
||||||
elif method is FlashMethod.SD_CARD:
|
fw_file_exists = (
|
||||||
fw_file_exists = target.joinpath("klipper.bin").exists()
|
target.joinpath(f1).exists() and target.joinpath(f2).exists()
|
||||||
else:
|
) or target.joinpath(f3).exists()
|
||||||
raise Exception("Unknown flash method")
|
|
||||||
|
|
||||||
return target_exists and fw_file_exists
|
return target_exists and fw_file_exists
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class KlipperFlashMethodMenu(BaseMenu):
|
|||||||
self.goto_next_menu()
|
self.goto_next_menu()
|
||||||
|
|
||||||
def goto_next_menu(self, **kwargs):
|
def goto_next_menu(self, **kwargs):
|
||||||
if find_firmware_file(self.flash_options.flash_method):
|
if find_firmware_file():
|
||||||
KlipperFlashCommandMenu(previous_menu=self.__class__).run()
|
KlipperFlashCommandMenu(previous_menu=self.__class__).run()
|
||||||
else:
|
else:
|
||||||
KlipperNoFirmwareErrorMenu().run()
|
KlipperNoFirmwareErrorMenu().run()
|
||||||
|
|||||||
Reference in New Issue
Block a user