Skip to content

Commit d8a0dba

Browse files
committed
Add teensy_secure support
1 parent b003257 commit d8a0dba

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

builder/main.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
OBJCOPY="arm-none-eabi-objcopy",
9797
RANLIB="arm-none-eabi-gcc-ranlib",
9898
SIZETOOL="arm-none-eabi-size",
99-
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES"
99+
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES",
100+
TEENSYSECURE="teensy_secure"
100101
)
101102

102103
env.Append(
@@ -127,6 +128,21 @@
127128
)
128129
)
129130

131+
if build_core == "teensy4":
132+
env.Append(
133+
BUILDERS=dict(
134+
HexToEhex=Builder(
135+
action=env.VerboseAction(" ".join([
136+
"$TEENSYSECURE",
137+
"encrypthex",
138+
board_config.id.upper(),
139+
"$SOURCES"
140+
]), "Encrypting $TARGET"),
141+
suffix=".ehex"
142+
)
143+
)
144+
)
145+
130146
if not env.get("PIOFRAMEWORK"):
131147
env.SConscript("frameworks/_bare_arm.py")
132148

@@ -174,6 +190,8 @@ def teensy_check_upload_size(_, target, source, env):
174190
else:
175191
target_elf = env.BuildProgram()
176192
target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf)
193+
if build_core == "teensy4":
194+
target_firm = env.HexToEhex(join("$BUILD_DIR", "${PROGNAME}"), target_firm)
177195
env.Depends(target_firm, "checkprogsize")
178196

179197
AlwaysBuild(env.Alias("nobuild", target_firm))

0 commit comments

Comments
 (0)