🔨 Configurable firmware bin filename
Configuration.h > FIRMWARE_BIN
This commit is contained in:
parent
a3964b2b40
commit
a2349fc411
|
@ -48,6 +48,15 @@ def encrypt_mks(source, target, env, new_name):
|
||||||
|
|
||||||
key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]
|
key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]
|
||||||
|
|
||||||
|
# If FIRMWARE_BIN is defined by config, override all
|
||||||
|
import re
|
||||||
|
patt = re.compile("^\\s*#define\\s+FIRMWARE_BIN\\s+\"?(.+)\"?")
|
||||||
|
with open(join("Marlin", "Configuration.h")) as f:
|
||||||
|
for line in f:
|
||||||
|
m = patt.search(line)
|
||||||
|
if m != None:
|
||||||
|
new_name = m.group(1)
|
||||||
|
|
||||||
fwpath = target[0].path
|
fwpath = target[0].path
|
||||||
fwfile = open(fwpath, "rb")
|
fwfile = open(fwpath, "rb")
|
||||||
enfile = open(target[0].dir.path + "/" + new_name, "wb")
|
enfile = open(target[0].dir.path + "/" + new_name, "wb")
|
||||||
|
|
Loading…
Reference in a new issue