Marlin 2.0 for Flying Bear 4S/5
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.

23 lines
643 B

#
4 years ago
# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
# Customizations for env:STM32F103VE_longer
#
4 years ago
import os,marlin
# Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
def encrypt(source, target, env):
firmware = open(target[0].path, "rb")
4 years ago
renamed = open(target[0].dir.path + '/project.bin', "wb")
length = os.path.getsize(target[0].path)
position = 0
try:
while position < length:
byte = firmware.read(1)
4 years ago
renamed.write(byte)
position += 1
finally:
firmware.close()
4 years ago
renamed.close()
4 years ago
marlin.add_post_action(encrypt);