Skip to content

Commit 4204d1e

Browse files
authored
Handle PSRAM libs in PlatformIO build script (#4911)
This PR adds PSRAM-specific libraries to the final linker command depending on the `BOARD_HAS_PSRAM` macro. cc @me-no-dev
1 parent d7fda91 commit 4204d1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: tools/platformio-build.py

+8
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@
187187
if not env.BoardConfig().get("build.ldscript", ""):
188188
env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", ""))
189189

190+
#
191+
# Add PSRAM-specific libraries
192+
#
193+
194+
flatten_cppdefines = env.Flatten(env["CPPDEFINES"])
195+
if "BOARD_HAS_PSRAM" in flatten_cppdefines:
196+
env.Append(LIBS=["c-psram-workaround", "m-psram-workaround"])
197+
190198
#
191199
# Target: Build Core Library
192200
#

0 commit comments

Comments
 (0)