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 849B

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