Skip to content

Commit 00f9977

Browse files
authored
change some if checks
1 parent 29b02a9 commit 00f9977

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

builder/frameworks/espidf.py

+5-22
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
IDF_ENV_VERSION = "1.0.0"
7070
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
7171
TOOLCHAIN_DIR = platform.get_package_dir(
72-
"toolchain-riscv32-esp"
73-
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4")
74-
else "toolchain-xtensa-esp-elf"
72+
"toolchain-xtensa-esp-elf"
73+
if mcu in ("esp32", "esp32s2", "esp32s3")
74+
else "toolchain-riscv32-esp"
7575
)
7676

7777

@@ -252,12 +252,6 @@ def populate_idf_env_vars(idf_env):
252252
os.path.dirname(get_python_exe()),
253253
]
254254

255-
# if mcu in ("esp32", "esp32s2", "esp32s3"):
256-
# additional_packages.append(
257-
# os.path.join(platform.get_package_dir("toolchain-esp32ulp"), "bin"),
258-
# )
259-
260-
261255
idf_env["PATH"] = os.pathsep.join(additional_packages + [idf_env["PATH"]])
262256

263257
# Some users reported that the `IDF_TOOLS_PATH` var can seep into the
@@ -509,7 +503,7 @@ def extract_linker_script_fragments_backup(framework_components_dir, sdk_config)
509503
sys.stderr.write("Error: Failed to extract paths to linker script fragments\n")
510504
env.Exit(1)
511505

512-
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4"):
506+
if mcu not in ("esp32", "esp32s2", "esp32s3"):
513507
result.append(os.path.join(framework_components_dir, "riscv", "linker.lf"))
514508

515509
# Add extra linker fragments
@@ -1300,17 +1294,6 @@ def _get_installed_pip_packages(python_exe_path):
13001294
)
13011295
)
13021296

1303-
# # A special "esp-windows-curses" python package is required on Windows
1304-
# # for Menuconfig on IDF <5
1305-
# if not IDF5 and "esp-windows-curses" not in installed_packages:
1306-
# env.Execute(
1307-
# env.VerboseAction(
1308-
# '"%s" -m pip install "file://%s/tools/kconfig_new/esp-windows-curses"'
1309-
# % (python_exe_path, FRAMEWORK_DIR),
1310-
# "Installing windows-curses package",
1311-
# )
1312-
# )
1313-
13141297

13151298
def get_idf_venv_dir():
13161299
# The name of the IDF venv contains the IDF version to avoid possible conflicts and
@@ -1675,7 +1658,7 @@ def _skip_prj_source_files(node):
16751658
(
16761659
board.get(
16771660
"upload.bootloader_offset",
1678-
"0x0" if mcu in ["esp32c2", "esp32c3", "esp32c6", "esp32s3", "esp32h2"] else ("0x2000" if mcu in ["esp32p4"] else "0x1000"),
1661+
"0x1000" if mcu in ["esp32", "esp32s2"] else ("0x2000" if mcu in ["esp32p4"] else "0x0"),
16791662
),
16801663
os.path.join("$BUILD_DIR", "bootloader.bin"),
16811664
),

0 commit comments

Comments
 (0)