Skip to content

Commit

Permalink
backout changes to stm32f4.ini & marlin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-the-Kuhn committed Jun 23, 2022
1 parent 6355798 commit 84e1ac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions buildroot/share/PlatformIO/scripts/marlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,22 @@ def encrypt_mks(source, target, env, new_name):
mf = env["MARLIN_FEATURES"]
if "FIRMWARE_BIN" in mf: new_name = mf["FIRMWARE_BIN"]

fwpath = target[0].path
fwfile = open(fwpath, "rb")
enfile = open(target[0].dir.path + "/" + new_name, "wb")
length = os.path.getsize(fwpath)
firmware = open(target[0].path, "rb")
renamed = open(target[0].dir.path + "/" + new_name, "wb")
length = os.path.getsize(target[0].path)
position = 0
try:
while position < length:
byte = fwfile.read(1)
byte = firmware.read(1)
if position >= 320 and position < 31040:
byte = chr(ord(byte) ^ key[position & 31])
if sys.version_info[0] > 2:
byte = bytes(byte, 'latin1')
enfile.write(byte)
renamed.write(byte)
position += 1
finally:
fwfile.close()
enfile.close()
os.remove(fwpath)
firmware.close()
renamed.close()

def add_post_action(action):
env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action);
4 changes: 2 additions & 2 deletions ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ build_flags = ${stm_flash_drive.build_flags}
extends = stm32_variant
board = marlin_STM32F407ZGT6
board_build.variant = MARLIN_LERDGE
board_build.encrypt = firmware.bin
board_build.offset = 0x10000
build_flags = ${stm32_variant.build_flags}
-DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4
-DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35
build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
extra_scripts = ${common_stm32.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
extra_scripts = ${stm32_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/lerdge.py

#
Expand Down

0 comments on commit 84e1ac4

Please sign in to comment.