Marlin/buildroot/share/PlatformIO/scripts/mks_encrypt.py
ellensp 08155b4875 🔨 Creality v4 with STM32 HAL (#21999)
- New STM32 env for Creality V4 boards.
- Separate Libmaple targets into their own `ini` file.
- Temporarily remove unusable targets from `pins.h`.

Co-authored-by: ellensp <ellensp@hotmsil.com>
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
2021-06-02 01:44:55 -05:00

29 lines
702 B
Python

#
# buildroot/share/PlatformIO/scripts/mks_encrypt.py
#
# Apply encryption and save as 'build.firmware' for these environments:
# - env:mks_robin
# - env:flsun_hispeedv1
# - env:mks_robin_nano35
#
Import("env")
from SCons.Script import DefaultEnvironment
board = DefaultEnvironment().BoardConfig()
if 'firmware' in board.get("build").keys():
import marlin
# Encrypt ${PROGNAME}.bin and save it as build.firmware
def encrypt(source, target, env):
marlin.encrypt_mks(source, target, env, board.get("build.firmware"))
marlin.add_post_action(encrypt);
else:
import sys
print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr)
env.Exit(1);