Javascript cleanup

This commit is contained in:
2026-03-04 12:03:39 +01:00
parent 56b9d04cf8
commit 627790b5fc
7 changed files with 31 additions and 303 deletions

View File

@@ -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(