Javascript cleanup
This commit is contained in:
@@ -53,6 +53,15 @@ def postbuild(source, target, env):
|
||||
firmware = env.subst("$BUILD_DIR/${PROGNAME}.bin")
|
||||
(fwname, fwversion) = getFirmwareInfo(firmware)
|
||||
|
||||
pcbvers = "unknown"
|
||||
for x in env["BUILD_FLAGS"]:
|
||||
if not x.startswith('-D'):
|
||||
continue
|
||||
opt = x[2:].strip()
|
||||
if opt.startswith("HARDWARE_"):
|
||||
pcbvers = x.split('_')[1].lower()
|
||||
print(f"compiled for pcb version {pcbvers}")
|
||||
|
||||
esptool = env.get('UPLOADER')
|
||||
uploaderflags = env.subst("${UPLOADERFLAGS}")
|
||||
base = env.subst("$PIOENV")
|
||||
@@ -91,9 +100,9 @@ def postbuild(source, target, env):
|
||||
env.Execute(' '.join(cmd), "#merging bin files")
|
||||
|
||||
# Create symlinks to better identify firmware
|
||||
fw_update = os.path.join(outdir, f"{base}-{fwversion}-update.bin")
|
||||
fw_update = os.path.join(outdir, f"{base}_{pcbvers}-{fwversion}-update.bin")
|
||||
os.symlink(firmware, fw_update)
|
||||
fw_full = os.path.join(outdir, f"{base}-{fwversion}-all.bin")
|
||||
fw_full = os.path.join(outdir, f"{base}_{pcbvers}-{fwversion}-all.bin")
|
||||
os.symlink(outfile, fw_full)
|
||||
|
||||
env.AddPostAction(
|
||||
|
||||
Reference in New Issue
Block a user