mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-23 15:53:36 +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
|
||||
|
||||
|
||||
def find_firmware_file(method: FlashMethod) -> bool:
|
||||
def find_firmware_file() -> bool:
|
||||
target = KLIPPER_DIR.joinpath("out")
|
||||
target_exists = target.exists()
|
||||
if method is FlashMethod.REGULAR:
|
||||
|
||||
f1 = "klipper.elf.hex"
|
||||
f2 = "klipper.elf"
|
||||
fw_file_exists = target.joinpath(f1).exists() and target.joinpath(f2).exists()
|
||||
elif method is FlashMethod.SD_CARD:
|
||||
fw_file_exists = target.joinpath("klipper.bin").exists()
|
||||
else:
|
||||
raise Exception("Unknown flash method")
|
||||
f3 = "klipper.bin"
|
||||
fw_file_exists = (
|
||||
target.joinpath(f1).exists() and target.joinpath(f2).exists()
|
||||
) or target.joinpath(f3).exists()
|
||||
|
||||
return target_exists and fw_file_exists
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class KlipperFlashMethodMenu(BaseMenu):
|
||||
self.goto_next_menu()
|
||||
|
||||
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()
|
||||
else:
|
||||
KlipperNoFirmwareErrorMenu().run()
|
||||
|
||||
Reference in New Issue
Block a user