Marlin 2.0 for Flying Bear 4S/5
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
740 B

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