Skip to content

Commit

Permalink
Add teensy_secure support
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilverman committed Nov 8, 2022
1 parent 4af2ef0 commit 67ef88f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-gcc-ranlib",
SIZETOOL="arm-none-eabi-size",
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES"
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES",
TEENSYSECURE="teensy_secure"
)

env.Append(
Expand Down Expand Up @@ -125,6 +126,21 @@
)
)

if build_core == "teensy4":
env.Append(
BUILDERS=dict(
HexToEhex=Builder(
action=env.VerboseAction(" ".join([
"$TEENSYSECURE",
"encrypthex",
board_config.id.upper(),
"$SOURCES"
]), "Encrypting $TARGET"),
suffix=".ehex"
)
)
)

if not env.get("PIOFRAMEWORK"):
env.SConscript("frameworks/_bare_arm.py")

Expand Down Expand Up @@ -161,6 +177,8 @@
else:
target_elf = env.BuildProgram()
target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf)
if build_core == "teensy4":
target_firm = env.HexToEhex(join("$BUILD_DIR", "${PROGNAME}"), target_firm)
env.Depends(target_firm, "checkprogsize")

AlwaysBuild(env.Alias("nobuild", target_firm))
Expand Down

0 comments on commit 67ef88f

Please sign in to comment.