Skip to content

Commit

Permalink
proposed changes for pio from @mcspr
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v committed Nov 7, 2023
1 parent cf8c528 commit d7a9f56
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,23 @@ def scons_patched_match_splitext(path, suffixes=None):
#

current_vtables = None
fp_in_irom = ""
current_fp = None
for d in flatten_cppdefines:
if str(d).startswith("VTABLES_IN_"):
current_vtables = d
if str(d) == "FP_IN_IROM":
fp_in_irom = "-DFP_IN_IROM"
if str(d).startswith("FP_IN_"):
current_fp = d

if not current_vtables:
current_vtables = "VTABLES_IN_FLASH"
env.Append(CPPDEFINES=[current_vtables])
assert current_vtables

if not current_fp:
current_fp = "FP_IN_IROM"
env.Append(CPPDEFINES=[current_fp])
assert current_fp

#
# MMU
#
Expand Down Expand Up @@ -363,17 +369,17 @@ def scons_patched_match_splitext(path, suffixes=None):
join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld"),
join(FRAMEWORK_DIR, "tools", "sdk", "ld", "eagle.app.v6.common.ld.h"),
env.VerboseAction(
"$CC -CC -E -P -D%s %s %s $SOURCE -o $TARGET"
"$CC -CC -E -P -D%s -D%s %s $SOURCE -o $TARGET"
% (
current_vtables,
current_fp,
# String representation of MMU flags
" ".join(
[
"-D%s=%s" % f if isinstance(f, (tuple, list)) else "-D" + f
for f in mmu_flags
]
),
fp_in_irom,
),
"Generating LD script $TARGET",
),
Expand Down

0 comments on commit d7a9f56

Please sign in to comment.