Skip to content

Commit

Permalink
Fix fail for IDF < v5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 committed Jul 30, 2024
1 parent 1876532 commit 1c6c0d5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@
idf_variant = mcu.lower()

# Required until Arduino switches to v5
IDF5 = (
platform.get_package_version("framework-espidf")
.split(".")[1]
.startswith("5")
)
IDF_version = platform.get_package_version("framework-espidf")
IDF5 = IDF_version.split(".")[1].startswith("5")
IDF_minor = int(("".join(IDF_version.split(".")[1]))[1:3])
IDF_ENV_VERSION = "1.0.0"
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
TOOLCHAIN_DIR = platform.get_package_dir(
Expand Down Expand Up @@ -661,7 +659,7 @@ def generate_project_ld_script(sdk_config, ignore_targets=None):
"sections.ld.in",
)

if IDF5:
if IDF5 and IDF_minor > 2:
initial_ld_script = preprocess_linker_file(
initial_ld_script,
os.path.join(
Expand Down Expand Up @@ -1419,7 +1417,7 @@ def get_python_exe():
"memory.ld.in",
))

if IDF5:
if IDF5 and IDF_minor > 2:
initial_ld_script = preprocess_linker_file(
initial_ld_script,
os.path.join(
Expand Down

0 comments on commit 1c6c0d5

Please sign in to comment.