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.

generic_create_variant.py 905B

123456789101112131415161718192021222324252627282930
  1. #
  2. # Generate a generic variant
  3. #
  4. import os,shutil
  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")
  11. assert os.path.isdir(FRAMEWORK_DIR)
  12. assert os.path.isdir("buildroot/share/PlatformIO/variants")
  13. mcu_type = board.get("build.mcu")[:-2]
  14. variant = board.get("build.variant")
  15. series = mcu_type[:7].upper() + "xx"
  16. variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant)
  17. source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant)
  18. assert os.path.isdir(source_dir)
  19. if not os.path.isdir(variant_dir):
  20. os.mkdir(variant_dir)
  21. for file_name in os.listdir(source_dir):
  22. full_file_name = os.path.join(source_dir, file_name)
  23. if os.path.isfile(full_file_name):
  24. shutil.copy(full_file_name, variant_dir)