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

12345678910111213141516171819202122232425262728293031323334
  1. import os,shutil
  2. from SCons.Script import DefaultEnvironment
  3. from platformio import util
  4. def copytree(src, dst, symlinks=False, ignore=None):
  5. for item in os.listdir(src):
  6. s = os.path.join(src, item)
  7. d = os.path.join(dst, item)
  8. if os.path.isdir(s):
  9. shutil.copytree(s, d, symlinks, ignore)
  10. else:
  11. shutil.copy2(s, d)
  12. env = DefaultEnvironment()
  13. platform = env.PioPlatform()
  14. board = env.BoardConfig()
  15. FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32-maple")
  16. assert os.path.isdir(FRAMEWORK_DIR)
  17. assert os.path.isdir("buildroot/share/PlatformIO/variants")
  18. variant = board.get("build.variant")
  19. variant_dir = os.path.join(FRAMEWORK_DIR, "STM32F1", "variants", variant)
  20. source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant)
  21. assert os.path.isdir(source_dir)
  22. if os.path.isdir(variant_dir):
  23. shutil.rmtree(variant_dir)
  24. if not os.path.isdir(variant_dir):
  25. os.mkdir(variant_dir)
  26. copytree(source_dir, variant_dir)