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:
Scott Lahteine
2021-04-27 04:49:21 -05:00
committed by GitHub
parent 69d85cce2d
commit ee016e605c
167 changed files with 340 additions and 840 deletions

View File

@ -1,20 +1,16 @@
#
# lerdge.py
# Customizations for Lerdge build environments
# buildroot/share/PlatformIO/scripts/lerdge.py
# Customizations for Lerdge build environments:
# env:LERDGEX env:LERDGEX_usb_flash_drive
# env:LERDGES env:LERDGES_usb_flash_drive
# env:LERDGEK env:LERDGEK_usb_flash_drive
#
import os,sys
import os,marlin
Import("env")
from SCons.Script import DefaultEnvironment
board = DefaultEnvironment().BoardConfig()
custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/lerdge.ld")
for i, flag in enumerate(env["LINKFLAGS"]):
if "-Wl,-T" in flag:
env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
elif flag == "-T":
env["LINKFLAGS"][i + 1] = custom_ld_script
def encryptByte(byte):
byte = 0xFF & ((byte << 6) | (byte >> 2))
i = 0x58 + byte
@ -35,16 +31,16 @@ def encrypt_file(input, output_file, file_length):
def encrypt(source, target, env):
print("Encrypting to:", board.get("build.firmware"))
firmware = open(target[0].path, "rb")
result = open(target[0].dir.path + "/" + board.get("build.firmware"), "wb")
renamed = open(target[0].dir.path + "/" + board.get("build.firmware"), "wb")
length = os.path.getsize(target[0].path)
encrypt_file(firmware, result, length)
encrypt_file(firmware, renamed, length)
firmware.close()
result.close()
renamed.close()
if 'firmware' in board.get("build").keys():
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
marlin.add_post_action(encrypt);
else:
print("You need to define output file via board_build.firmware = 'filename' parameter")
exit(1);