From 67ef88f2c59c563af6f415994a723160f9bb8cf3 Mon Sep 17 00:00:00 2001 From: Shawn Silverman Date: Mon, 7 Nov 2022 18:51:36 -0800 Subject: [PATCH] Add teensy_secure support --- builder/main.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index 9ff6490..ca1acbf 100644 --- a/builder/main.py +++ b/builder/main.py @@ -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( @@ -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") @@ -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))