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.

jgaurora_a5s_a1_with_bootloader.py 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. #
  2. # jgaurora_a5s_a1_with_bootloader.py
  3. # Customizations for env:jgaurora_a5s_a1
  4. #
  5. import pioutil
  6. if pioutil.is_pio_build():
  7. # Append ${PROGNAME}.bin firmware after bootloader and save it as 'jgaurora_firmware.bin'
  8. def addboot(source, target, env):
  9. from pathlib import Path
  10. fw_path = Path(target[0].path)
  11. fwb_path = fw_path.parent / 'firmware_with_bootloader.bin'
  12. with fwb_path.open("wb") as fwb_file:
  13. bl_path = Path("buildroot/share/PlatformIO/scripts/jgaurora_bootloader.bin")
  14. bl_file = bl_path.open("rb")
  15. while True:
  16. b = bl_file.read(1)
  17. if b == b'': break
  18. else: fwb_file.write(b)
  19. with fw_path.open("rb") as fw_file:
  20. while True:
  21. b = fw_file.read(1)
  22. if b == b'': break
  23. else: fwb_file.write(b)
  24. fws_path = Path(target[0].dir.path, 'firmware_for_sd_upload.bin')
  25. if fws_path.exists():
  26. fws_path.unlink()
  27. fw_path.rename(fws_path)
  28. import marlin
  29. marlin.add_post_action(addboot);