mirror of https://github.com/arendst/Tasmota.git
fix 4MB PIO script upload regression
This commit is contained in:
parent
80617e96e1
commit
222b47627f
|
@ -29,15 +29,17 @@ if "upload" in COMMAND_LINE_TARGETS:
|
|||
old_maximum_size = env.BoardConfig().get("upload.maximum_size")
|
||||
new_maximum_size = int(size.split("MB")[0]) * 0x100000
|
||||
|
||||
extra_flags = env.BoardConfig().get("build.extra_flags").split(" ")
|
||||
new_flags = ""
|
||||
for flag in extra_flags:
|
||||
if flag.startswith("-DESP32"):
|
||||
flag = f"-DESP32_{size}"
|
||||
new_flags += flag + " "
|
||||
env.BoardConfig().update("build.extra_flags",new_flags)
|
||||
env.BoardConfig().update("upload.flash_size",size)
|
||||
if new_maximum_size > old_maximum_size:
|
||||
|
||||
env.BoardConfig().update("upload.maximum_size", new_maximum_size)
|
||||
extra_flags = env.BoardConfig().get("build.extra_flags").split(" ")
|
||||
new_flags = ""
|
||||
for flag in extra_flags:
|
||||
if flag.startswith("-DESP32"):
|
||||
flag = f"-DESP32_{size}"
|
||||
new_flags += flag + " "
|
||||
env.BoardConfig().update("build.extra_flags",new_flags)
|
||||
env.BoardConfig().update("upload.flash_size",size)
|
||||
|
||||
env.Replace(TASMOTA_flash_size=size)
|
||||
env.BoardConfig().update("upload.maximum_size", new_maximum_size)
|
||||
|
||||
env.Replace(TASMOTA_flash_size=size)
|
|
@ -74,10 +74,11 @@ def patch_partitions_bin(size_string):
|
|||
def esp32_detect_flashsize():
|
||||
if not "upload" in COMMAND_LINE_TARGETS:
|
||||
return "4MB",False
|
||||
try:
|
||||
return env.get("TASMOTA_flash_size"),True
|
||||
except:
|
||||
size = env.get("TASMOTA_flash_size")
|
||||
if size == None:
|
||||
return "4MB",False
|
||||
else:
|
||||
return size,True
|
||||
|
||||
def esp32_create_chip_string(chip):
|
||||
tasmota_platform = env.subst("$BUILD_DIR").split(os.path.sep)[-1]
|
||||
|
|
Loading…
Reference in New Issue