Browse Source

🔨 Get FIRMWARE_BIN from env

Scott Lahteine 2 years ago
parent
commit
54f218e348
1 changed files with 2 additions and 7 deletions
  1. 2
    7
      buildroot/share/PlatformIO/scripts/marlin.py

+ 2
- 7
buildroot/share/PlatformIO/scripts/marlin.py View File

@@ -49,13 +49,8 @@ def encrypt_mks(source, target, env, new_name):
49 49
 	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]
50 50
 
51 51
 	# If FIRMWARE_BIN is defined by config, override all
52
-	import re
53
-	patt = re.compile("^\\s*#define\\s+FIRMWARE_BIN\\s+\"?(.+)\"?")
54
-	with open(join("Marlin", "Configuration.h"), encoding="utf-8") as f:
55
-		for line in f:
56
-			m = patt.search(line)
57
-			if m != None:
58
-				new_name = m.group(1)
52
+	mf = env["MARLIN_FEATURES"]
53
+	if "FIRMWARE_BIN" in mf: new_name = mf["FIRMWARE_BIN"]
59 54
 
60 55
 	fwpath = target[0].path
61 56
 	fwfile = open(fwpath, "rb")

Loading…
Cancel
Save