mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-06 14:37:27 -06:00
Rename, clean up boards/variants (#21655)
* Consolidate variant scripts * Rename Marlin-local boards * Simplify variants where possible * Rename variants * CHITU_F103 and MEEB_3DP: Maple platform `platformio-build-stm32f1.py` uses the 'board' name, not 'board_build.variant' so folder names match 'board' and not `board_build.variant`.
This commit is contained in:
parent
69d85cce2d
commit
ee016e605c
167 changed files with 340 additions and 840 deletions
|
@ -1,32 +1,28 @@
|
|||
import os,sys
|
||||
#
|
||||
# buildroot/share/PlatformIO/scripts/mks_encrypt.py
|
||||
#
|
||||
# Apply encryption and save as 'build.firmware' for these environments:
|
||||
# - env:mks_robin_stm32
|
||||
# - env:flsun_hispeedv1
|
||||
# - env:mks_robin_nano35_stm32
|
||||
#
|
||||
Import("env")
|
||||
|
||||
from SCons.Script import DefaultEnvironment
|
||||
board = DefaultEnvironment().BoardConfig()
|
||||
|
||||
# Encrypt ${PROGNAME}.bin and save it as build.firmware ('Robin.bin')
|
||||
def encrypt(source, target, env):
|
||||
key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]
|
||||
|
||||
firmware = open(target[0].path, "rb")
|
||||
robin = open(target[0].dir.path +'/'+ board.get("build.firmware"), "wb")
|
||||
length = os.path.getsize(target[0].path)
|
||||
position = 0
|
||||
try:
|
||||
while position < length:
|
||||
byte = firmware.read(1)
|
||||
if position >= 320 and position < 31040:
|
||||
byte = chr(ord(byte) ^ key[position & 31])
|
||||
if sys.version_info[0] > 2:
|
||||
byte = bytes(byte, 'latin1')
|
||||
robin.write(byte)
|
||||
position += 1
|
||||
finally:
|
||||
firmware.close()
|
||||
robin.close()
|
||||
|
||||
if 'firmware' in board.get("build").keys():
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
|
||||
|
||||
import marlin
|
||||
|
||||
# Encrypt ${PROGNAME}.bin and save it as build.firmware
|
||||
def encrypt(source, target, env):
|
||||
marlin.encrypt_mks(source, target, env, "build.firmware")
|
||||
|
||||
marlin.add_post_action(encrypt);
|
||||
|
||||
else:
|
||||
print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr)
|
||||
exit(1);
|
||||
|
||||
import sys
|
||||
print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr)
|
||||
env.Exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue