Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spi_flash.py #504

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scripts/spi_flash/fatfs_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# This file may be distributed under the terms of the GNU GPLv3 license.
import os
import sys
import pathlib

KLIPPER_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
sys.path.append(os.path.join(KLIPPER_DIR, "klippy"))

import chelper # noqa: E402
KLIPPER_DIR = pathlib.Path(__file__).parent.parent.parent
sys.path.insert(0, str(KLIPPER_DIR))
from klippy import chelper # noqa: E402

DEST_LIB = "fatfs.so"
FATFS_DIR = os.path.join(KLIPPER_DIR, "lib/fatfs")
FATFS_DIR = str(KLIPPER_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"]
Expand Down
5 changes: 4 additions & 1 deletion scripts/spi_flash/spi_flash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python
# Module supporting uploads Klipper firmware to an SD Card via SPI and SDIO
#
# Copyright (C) 2021 Eric Callahan <[email protected]>
Expand All @@ -17,6 +17,9 @@
import json
import board_defs
import fatfs_lib
import pathlib

sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.parent))
from klippy import reactor, serialhdl, clocksync, mcu

###########################################################
Expand Down
Loading