|
@@ -10,29 +10,31 @@ if pioutil.is_pio_build():
|
|
|
env = pioutil.env
|
|
|
|
|
|
# Check whether the "update" folder exists
|
|
|
- outpath = "update"
|
|
|
+ outpath = f"{env['PROJECT_BUILD_DIR']}/{env['PIOENV']}/update"
|
|
|
if not os.path.exists(outpath): os.makedirs(outpath)
|
|
|
|
|
|
# Build "fmw_tronxy.hex" and place in "update" folder
|
|
|
def output_target_hex():
|
|
|
- tar_hex = f"{outpath}/fmw_tronxy.hex"
|
|
|
+ hex_path = f"update/fmw_tronxy.hex"
|
|
|
+ hex_long = f"$PROJECT_BUILD_DIR/$PIOENV/{hex_path}"
|
|
|
env.AddPostAction(
|
|
|
"$BUILD_DIR/${PROGNAME}.elf",
|
|
|
env.VerboseAction(" ".join([
|
|
|
"$OBJCOPY", "-O", "ihex", "-R", ".eeprom",
|
|
|
- "$BUILD_DIR/${PROGNAME}.elf", tar_hex
|
|
|
- ]), "Building %s" % tar_hex)
|
|
|
+ "$BUILD_DIR/${PROGNAME}.elf", hex_long
|
|
|
+ ]), f"Building {hex_path}")
|
|
|
)
|
|
|
|
|
|
# Build "fmw_tronxy.bin" and place in "update" folder
|
|
|
def output_target_bin():
|
|
|
- tar_bin = f"{outpath}/fmw_tronxy.bin"
|
|
|
+ bin_path = f"update/fmw_tronxy.bin"
|
|
|
+ bin_long = f"$PROJECT_BUILD_DIR/$PIOENV/{bin_path}"
|
|
|
env.AddPostAction(
|
|
|
"$BUILD_DIR/${PROGNAME}.elf",
|
|
|
env.VerboseAction(" ".join([
|
|
|
"$OBJCOPY", "-O", "binary", "-R", ".eeprom",
|
|
|
- "$BUILD_DIR/${PROGNAME}.elf", tar_bin
|
|
|
- ]), "Building %s" % tar_bin)
|
|
|
+ "$BUILD_DIR/${PROGNAME}.elf", bin_long
|
|
|
+ ]), f"Building {bin_path}")
|
|
|
)
|
|
|
|
|
|
output_target_hex()
|