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
This commit is contained in:
Valerii Koval 2021-03-09 00:21:52 +02:00 committed by GitHub
parent d7fda910fb
commit 4204d1e60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,6 +187,14 @@ env.Append(
if not env.BoardConfig().get("build.ldscript", ""): if not env.BoardConfig().get("build.ldscript", ""):
env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", "")) env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", ""))
#
# Add PSRAM-specific libraries
#
flatten_cppdefines = env.Flatten(env["CPPDEFINES"])
if "BOARD_HAS_PSRAM" in flatten_cppdefines:
env.Append(LIBS=["c-psram-workaround", "m-psram-workaround"])
# #
# Target: Build Core Library # Target: Build Core Library
# #