mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-11 16:57:49 -06:00
🔨 Simplify generic variants, update DFU tool (#27502)
This commit is contained in:
parent
7b104a108f
commit
08717d3f60
26 changed files with 110 additions and 100 deletions
|
@ -40,26 +40,17 @@ if pioutil.is_pio_build():
|
|||
FRAMEWORK_DIR = Path(platform.get_package_dir(platform_name))
|
||||
assert FRAMEWORK_DIR.is_dir()
|
||||
|
||||
#
|
||||
# Point variants_dir to our variant folder when board_build.variant
|
||||
# is provided and the variant name begins with "marlin_".
|
||||
#
|
||||
board = env.BoardConfig()
|
||||
|
||||
#mcu_type = board.get("build.mcu")[:-2]
|
||||
variant = board.get("build.variant")
|
||||
#mcu_type = board.get("build.mcu")[:-2]
|
||||
#series = mcu_type[:7].upper() + "xx"
|
||||
|
||||
# Only prepare a new variant if the PlatformIO configuration provides it (board_build.variant).
|
||||
# This check is important to avoid deleting official board config variants.
|
||||
# Make sure the local variant sub-folder exists
|
||||
if marlin_variant_pattern.match(str(variant).lower()):
|
||||
# Prepare a new empty folder at the destination
|
||||
variant_dir = FRAMEWORK_DIR / "variants" / variant
|
||||
if variant_dir.is_dir():
|
||||
shutil.rmtree(variant_dir)
|
||||
if not variant_dir.is_dir():
|
||||
variant_dir.mkdir()
|
||||
|
||||
# Source dir is a local variant sub-folder
|
||||
source_dir = Path("buildroot/share/PlatformIO/variants", variant)
|
||||
assert source_dir.is_dir()
|
||||
|
||||
print("Copying variant " + str(variant) + " to framework directory...")
|
||||
|
||||
marlin.copytree(source_dir, variant_dir)
|
||||
board.update("build.variants_dir", "buildroot/share/PlatformIO/variants");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue