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 10, 2024
1 parent 3ede3a7 commit b20756c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@
flag_custom_sdkonfig = False

def HandleArduinoIDFsettings(env):
def get_MD5_hash(phrase):
import hashlib
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 @@ -136,7 +140,7 @@ def get_flag(line):
with open(sdkconfig_src) as src:
sdkconfig_dst = os.path.join(PROJECT_DIR, "sdkconfig.defaults")
dst = open(sdkconfig_dst,"w")
dst.write("# TASMOTA\n")
dst.write("# TASMOTA__"+ get_MD5_hash(env.GetProjectOption("custom_sdkconfig").strip()) +"\n")
while line := src.readline():
flag = get_flag(line)
# print(flag)
Expand Down

0 comments on commit b20756c

Please sign in to comment.