Skip to content

Commit

Permalink
Update espidf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Oct 11, 2024
1 parent 9295d63 commit d05f5c5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
assert os.path.isdir(FRAMEWORK_DIR)
assert os.path.isdir(TOOLCHAIN_DIR)

# The latest IDF uses a standalone GDB package which requires at least PlatformIO 6.1.11
if (
["espidf"] == env.get("PIOFRAMEWORK")
and semantic_version.Version.coerce(__version__)
Expand All @@ -89,7 +88,7 @@
):
print("Warning! Debugging an IDF project requires PlatformIO Core >= 6.1.11!")

# Arduino framework as a component is not compatible with ESP-IDF >5.2
# Arduino framework as a component is not compatible with ESP-IDF >5.3
if "arduino" in env.subst("$PIOFRAMEWORK"):
ARDUINO_FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") # todo Tasmota ?
# Possible package names in 'package@version' format is not compatible with CMake
Expand Down Expand Up @@ -125,7 +124,7 @@ def get_MD5_hash(phrase):
return hashlib.md5((phrase).encode('utf-8')).hexdigest()[:16]

if flag_custom_sdkonfig == True:
print("*** Add \"custom_sdkconfig\" settings to IDF sdkconfig.defaults! ***")
print("*** Add \"custom_sdkconfig\" settings to IDF sdkconfig.defaults ***")
idf_config_flags = env.GetProjectOption("custom_sdkconfig").splitlines()
sdkconfig_src = join(ARDUINO_FRAMEWORK_DIR,"tools","esp32-arduino-libs",mcu,"sdkconfig")

Expand All @@ -143,16 +142,15 @@ def get_flag(line):
dst.write("# TASMOTA__"+ get_MD5_hash(env.GetProjectOption("custom_sdkconfig").strip() + mcu) +"\n")
while line := src.readline():
flag = get_flag(line)
# print(flag)
if flag is None:
dst.write(line)
else:
no_match = True
for item in idf_config_flags:
if flag in item:
dst.write(item+"\n")
dst.write(item.replace("\'", "")+"\n")
no_match = False
print("Replace:", line, "with:", item)
print("Replace:",line,"with:",item.replace("\'", ""))
if no_match:
dst.write(line)
dst.close()
Expand All @@ -174,9 +172,6 @@ def get_flag(line):
PIOFRAMEWORK="arduino",
ARDUINO_LIB_COMPILE_FLAG="Build",
)
# env.Append(
# BUILD_FLAGS="-mtext-section-literals" if mcu in ("esp32", "esp32s2", "esp32s3") else ""
# )
env["INTEGRATION_EXTRA_DATA"].update({"arduino_lib_compile_flag": env.subst("$ARDUINO_LIB_COMPILE_FLAG")})

def get_project_lib_includes(env):
Expand Down

0 comments on commit d05f5c5

Please sign in to comment.