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.

STM32F103VE_longer.py 643B

12345678910111213141516171819202122
  1. #
  2. # buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
  3. # Customizations for env:STM32F103VE_longer
  4. #
  5. import os,marlin
  6. # Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
  7. def encrypt(source, target, env):
  8. firmware = open(target[0].path, "rb")
  9. renamed = open(target[0].dir.path + '/project.bin', "wb")
  10. length = os.path.getsize(target[0].path)
  11. position = 0
  12. try:
  13. while position < length:
  14. byte = firmware.read(1)
  15. renamed.write(byte)
  16. position += 1
  17. finally:
  18. firmware.close()
  19. renamed.close()
  20. marlin.add_post_action(encrypt);