Skip to content

Commit a9fe7ed

Browse files
committed
Restore formatting
1 parent ae55b59 commit a9fe7ed

File tree

1 file changed

+61
-23
lines changed

1 file changed

+61
-23
lines changed

builder/main.py

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,44 @@ def __fetch_spiffs_size(target, source, env):
140140
SIZETOOL="xtensa-esp32-elf-size",
141141

142142
ARFLAGS=["rc"],
143+
143144
ASFLAGS=["-x", "assembler-with-cpp"],
145+
144146
CFLAGS=["-std=gnu99"],
147+
145148
CCFLAGS=[
146-
"-Os", "-Wall", "-nostdlib", "-Wpointer-arith",
147-
"-Wno-error=unused-but-set-variable", "-Wno-error=unused-variable",
148-
"-mlongcalls", "-ffunction-sections", "-fdata-sections",
149+
"-Os",
150+
"-Wall",
151+
"-nostdlib",
152+
"-Wpointer-arith",
153+
"-Wno-error=unused-but-set-variable",
154+
"-Wno-error=unused-variable",
155+
"-mlongcalls",
156+
"-ffunction-sections",
157+
"-fdata-sections",
149158
"-fstrict-volatile-bitfields"
150159
],
151-
CXXFLAGS=["-fno-rtti", "-fno-exceptions", "-std=gnu++11"],
160+
161+
CXXFLAGS=[
162+
"-fno-rtti",
163+
"-fno-exceptions",
164+
"-std=gnu++11"
165+
],
166+
152167
CPPDEFINES=[
153-
"ESP32", "ESP_PLATFORM", ("F_CPU", "$BOARD_F_CPU"), "HAVE_CONFIG_H",
168+
"ESP32",
169+
"ESP_PLATFORM",
170+
("F_CPU", "$BOARD_F_CPU"),
171+
"HAVE_CONFIG_H",
154172
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"')
155173
],
174+
156175
LINKFLAGS=[
157-
"-nostdlib", "-Wl,-static", "-u", "call_user_start_cpu0",
158-
"-Wl,--undefined=uxTopUsedPriority", "-Wl,--gc-sections"
176+
"-nostdlib",
177+
"-Wl,-static",
178+
"-u", "call_user_start_cpu0",
179+
"-Wl,--undefined=uxTopUsedPriority",
180+
"-Wl,--gc-sections"
159181
],
160182

161183
SIZEPROGREGEXP=r"^(?:\.iram0\.text|\.dram0\.text|\.flash\.text|\.dram0\.data|\.flash\.rodata|)\s+(\d+).*",
@@ -177,17 +199,24 @@ def __fetch_spiffs_size(target, source, env):
177199
BUILDERS=dict(
178200
ElfToBin=Builder(
179201
action=env.VerboseAction(" ".join([
180-
'"$PYTHONEXE" "$OBJCOPY"', "--chip", "esp32", "elf2image",
181-
"--flash_mode", "$BOARD_FLASH_MODE", "--flash_freq",
182-
"${__get_board_f_flash(__env__)}", "--flash_size",
183-
env.BoardConfig().get("upload.flash_size",
184-
"detect"), "-o", "$TARGET", "$SOURCES"
202+
'"$PYTHONEXE" "$OBJCOPY"',
203+
"--chip", "esp32",
204+
"elf2image",
205+
"--flash_mode", "$BOARD_FLASH_MODE",
206+
"--flash_freq", "${__get_board_f_flash(__env__)}",
207+
"--flash_size", env.BoardConfig().get(
208+
"upload.flash_size", "detect"),
209+
"-o", "$TARGET", "$SOURCES"
185210
]), "Building $TARGET"),
186211
suffix=".bin"),
187212
DataToBin=Builder(
188213
action=env.VerboseAction(" ".join([
189-
'"$MKSPIFFSTOOL"', "-c", "$SOURCES", "-p", "$SPIFFS_PAGE",
190-
"-b", "$SPIFFS_BLOCK", "-s", "$SPIFFS_SIZE", "$TARGET"
214+
'"$MKSPIFFSTOOL"',
215+
"-c", "$SOURCES",
216+
"-p", "$SPIFFS_PAGE",
217+
"-b", "$SPIFFS_BLOCK",
218+
"-s", "$SPIFFS_SIZE",
219+
"$TARGET"
191220
]), "Building SPIFFS image from '$SOURCES' directory to $TARGET"),
192221
emitter=__fetch_spiffs_size,
193222
source_factory=env.Dir,
@@ -252,11 +281,15 @@ def __fetch_spiffs_size(target, source, env):
252281
UPLOADEROTA=join(
253282
platform.get_package_dir("tool-espotapy") or "", "espota.py"),
254283
UPLOADERFLAGS=[
255-
"--chip", "esp32", "--port", '"$UPLOAD_PORT"', "--baud",
256-
"$UPLOAD_SPEED", "--before", "default_reset", "--after",
257-
"hard_reset", "write_flash", "-z", "--flash_mode",
258-
"${__get_board_flash_mode(__env__)}", "--flash_freq",
259-
"${__get_board_f_flash(__env__)}", "--flash_size", "detect"
284+
"--chip", "esp32",
285+
"--port", '"$UPLOAD_PORT"',
286+
"--baud", "$UPLOAD_SPEED",
287+
"--before", "default_reset",
288+
"--after", "hard_reset",
289+
"write_flash", "-z",
290+
"--flash_mode", "${__get_board_flash_mode(__env__)}",
291+
"--flash_freq", "${__get_board_f_flash(__env__)}",
292+
"--flash_size", "detect"
260293
],
261294
UPLOADEROTAFLAGS=[
262295
"--debug", "--progress", "-i", "$UPLOAD_PORT", "-p", "3232",
@@ -281,10 +314,15 @@ def __fetch_spiffs_size(target, source, env):
281314
if "uploadfs" in COMMAND_LINE_TARGETS:
282315
env.Replace(
283316
UPLOADERFLAGS=[
284-
"--chip", "esp32", "--port", '"$UPLOAD_PORT"', "--baud",
285-
"$UPLOAD_SPEED", "--before", "default_reset", "--after",
286-
"hard_reset", "write_flash", "-z", "--flash_mode",
287-
"$BOARD_FLASH_MODE", "--flash_size", "detect", "$SPIFFS_START"
317+
"--chip", "esp32",
318+
"--port", '"$UPLOAD_PORT"',
319+
"--baud", "$UPLOAD_SPEED",
320+
"--before", "default_reset",
321+
"--after", "hard_reset",
322+
"write_flash", "-z",
323+
"--flash_mode", "$BOARD_FLASH_MODE",
324+
"--flash_size", "detect",
325+
"$SPIFFS_START"
288326
],
289327
UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE',
290328
)

0 commit comments

Comments
 (0)