Skip to content

Commit 79ce473

Browse files
committed
Fix wrong handling of CPPDEFINES during boot2.S generation
1 parent 0a58a6a commit 79ce473

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

builder/frameworks/picosdk.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,13 @@ def build_cyw43_arch():
516516
# when calling into the RP2040 version of that script, it actually doesn't take a "-a" argument at all.
517517
pad_checksum_arch = ""
518518

519+
current_defines = []
520+
for x in env["CPPDEFINES"]:
521+
# can be a tuple (key, value) or just a key
522+
if isinstance(x, tuple):
523+
current_defines.append(f"-D{x[0]}={str(x[1])}")
524+
else:
525+
current_defines.append(f"-D{x}")
519526
gen_boot2_cmd = env.Command(
520527
join("$BUILD_DIR", "boot2.S"), # $TARGET
521528
join(FRAMEWORK_DIR, "src", mcu, "boot_stage2", "compile_time_choice.S"), # $SOURCE
@@ -525,7 +532,7 @@ def build_cyw43_arch():
525532
#"$ASFLAGS",
526533
#"$CCFLAGS",
527534
]
528-
+ ["-D%s=%s" % (flag[0], str(flag[1])) for flag in env["CPPDEFINES"]]
535+
+ current_defines
529536
+ [
530537
"-I\"%s\"" % join(FRAMEWORK_DIR, "src", mcu, "boot_stage2", "asminclude"),
531538
"-I\"%s\"" % join(FRAMEWORK_DIR, "src", mcu, "boot_stage2", "include"),

0 commit comments

Comments
 (0)