My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

STM32F1_create_variant.py 794B

123456789101112131415161718192021222324252627282930
  1. #
  2. # STM32F1_create_variant.py
  3. #
  4. import os,shutil,marlin
  5. from SCons.Script import DefaultEnvironment
  6. from platformio import util
  7. env = DefaultEnvironment()
  8. platform = env.PioPlatform()
  9. board = env.BoardConfig()
  10. FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32-maple")
  11. assert os.path.isdir(FRAMEWORK_DIR)
  12. source_root = os.path.join("buildroot", "share", "PlatformIO", "variants")
  13. assert os.path.isdir(source_root)
  14. variant = board.get("build.variant")
  15. variant_dir = os.path.join(FRAMEWORK_DIR, "STM32F1", "variants", variant)
  16. source_dir = os.path.join(source_root, variant)
  17. assert os.path.isdir(source_dir)
  18. if os.path.isdir(variant_dir):
  19. shutil.rmtree(variant_dir)
  20. if not os.path.isdir(variant_dir):
  21. os.mkdir(variant_dir)
  22. marlin.copytree(source_dir, variant_dir)