Skip to content

Commit fa11b9b

Browse files
committed
Merge branch 'release/v1.1.3' into develop
2 parents a4b5e48 + 8ee407e commit fa11b9b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

builder/main.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _get_board_f_flash(env):
155155
# SPIFFS
156156
#
157157

158-
def _fetch_spiffs_size(target, source, env):
158+
def fetch_spiffs_size(env):
159159
spiffs_re = re.compile(
160160
r"PROVIDE\s*\(\s*_SPIFFS_(\w+)\s*=\s*(0x[\dA-F]+)\s*\)")
161161
with open(env.GetActualLDScript()) as f:
@@ -179,6 +179,9 @@ def _fetch_spiffs_size(target, source, env):
179179

180180
env[k] = hex(_value)
181181

182+
183+
def __fetch_spiffs_size(target, source, env):
184+
fetch_spiffs_size(env)
182185
return (target, source)
183186

184187

@@ -193,7 +196,7 @@ def _fetch_spiffs_size(target, source, env):
193196
"-s", "${int(SPIFFS_END, 16) - int(SPIFFS_START, 16)}",
194197
"$TARGET"
195198
]), "Building SPIFFS image from '$SOURCES' directory to $TARGET"),
196-
emitter=_fetch_spiffs_size,
199+
emitter=__fetch_spiffs_size,
197200
source_factory=env.Dir,
198201
suffix=".bin"
199202
)
@@ -310,9 +313,20 @@ def _fetch_spiffs_size(target, source, env):
310313
# Target: Build executable and linkable firmware or SPIFFS image
311314
#
312315

316+
317+
def __tmp_hook_before_pio_3_2():
318+
env.ProcessFlags(env.get("BUILD_FLAGS"))
319+
# append specified LD_SCRIPT
320+
if ("LDSCRIPT_PATH" in env and
321+
not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
322+
env.Append(LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'])
323+
324+
313325
target_elf = None
314326
if "nobuild" in COMMAND_LINE_TARGETS:
315327
if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
328+
__tmp_hook_before_pio_3_2()
329+
fetch_spiffs_size(env)
316330
target_firm = join("$BUILD_DIR", "spiffs.bin")
317331
elif "PIOFRAMEWORK" not in env:
318332
target_firm = [
@@ -323,14 +337,7 @@ def _fetch_spiffs_size(target, source, env):
323337
target_firm = join("$BUILD_DIR", "firmware.bin")
324338
else:
325339
if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
326-
# @TODO, replace with env.ProcessAllFlags() after PIO 3.2 release
327-
env.ProcessFlags(env.get("BUILD_FLAGS"))
328-
# append specified LD_SCRIPT
329-
if ("LDSCRIPT_PATH" in env and
330-
not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
331-
env.Append(LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'])
332-
###
333-
340+
__tmp_hook_before_pio_3_2()
334341
target_firm = env.DataToBin(
335342
join("$BUILD_DIR", "spiffs"), "$PROJECTDATA_DIR")
336343
AlwaysBuild(target_firm)
@@ -344,8 +351,8 @@ def _fetch_spiffs_size(target, source, env):
344351
else:
345352
target_firm = env.ElfToBin(
346353
join("$BUILD_DIR", "firmware"), target_elf)
347-
target_buildprog = env.Alias("buildprog", target_firm)
348354

355+
target_buildprog = env.Alias("buildprog", target_firm)
349356
AlwaysBuild(env.Alias("nobuild", target_firm))
350357

351358
#

platform.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"type": "git",
1414
"url": "https://github.com/platformio/platform-espressif8266.git"
1515
},
16-
"version": "1.1.2",
16+
"version": "1.1.3",
1717
"packageRepositories": [
1818
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
1919
"https://sourceforge.net/projects/platformio-storage/files/packages/manifest.json/download",

0 commit comments

Comments
 (0)