muele-marlin/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
Scott Lahteine ee016e605c
Rename, clean up boards/variants (#21655)
* Consolidate variant scripts
* Rename Marlin-local boards
* Simplify variants where possible
* Rename variants
* CHITU_F103 and MEEB_3DP: Maple platform `platformio-build-stm32f1.py` uses the 'board' name, not 'board_build.variant' so folder names match 'board' and not `board_build.variant`.
2021-04-27 04:49:21 -05:00

23 lines
643 B
Python

#
# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
# Customizations for env:STM32F103VE_longer
#
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")
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)
renamed.write(byte)
position += 1
finally:
firmware.close()
renamed.close()
marlin.add_post_action(encrypt);