代码拉取完成,页面将自动刷新
Import("env")
# import os
# import shutil
# env.Replace(PROGNAME="firmware_%s" % env.GetProjectOption("custom_prog_version"))
env.Append(LINKFLAGS=["--specs=nosys.specs", "--specs=nano.specs"])
env.AddPostAction(
"$BUILD_DIR/${PROGNAME}.elf",
env.VerboseAction(" ".join([
"$OBJCOPY", "-O", "ihex", "-R", ".eeprom",
"$BUILD_DIR/${PROGNAME}.elf", "$BUILD_DIR/${PROGNAME}.hex"
]), "Building $BUILD_DIR/${PROGNAME}.hex")
)
# new_file_name = env.GetProjectOption("custom_prog_name") + "_main" \
# + "_V" + env.GetProjectOption("custom_firmware_version_major") + "." \
# + env.GetProjectOption("custom_firmware_version_minor") + "." \
# + env.GetProjectOption("custom_firmware_version_revision")
# env.AddPostAction(
# "$BUILD_DIR/${PROGNAME}.elf",
# env.VerboseAction(" ".join([
# "$OBJCOPY", "-O", "ihex", "-R", ".eeprom",
# "$BUILD_DIR/${PROGNAME}.elf", "$BUILD_DIR/" + new_file_name + ".hex"
# ]), "Building $BUILD_DIR/" + new_file_name + ".hex")
# )
# env.AddPostAction(
# "$BUILD_DIR/${PROGNAME}.elf",
# env.VerboseAction(" ".join([
# "$OBJCOPY", "-O", "binary",
# "$BUILD_DIR/${PROGNAME}.elf", "$BUILD_DIR/" + new_file_name + ".bin"
# ]), "Building $BUILD_DIR/" + new_file_name + ".bin")
# )
#print(env.get("PROGNAME", "no_name"))
# path = env.get("PROJECT_BUILD_DIR")
# sub_folder_path = env.get("PIOENV")
# old_file_name = env.get("PROGNAME")
# old_name = (path + "\\" + sub_folder_path + "\\" + old_file_name + ".bin")
# new_name = (path + "\\" + sub_folder_path + "\\" + new_file_name )
# old_name = (path + "\\" + sub_folder_path + "\\" + old_file_name + ".bin").replace('\\', '/')
# new_name = (path + "\\" + sub_folder_path + "\\" + new_file_name + "_main" + "_V" + env.GetProjectOption("custom_firmware_version_major") + "." + env.GetProjectOption("custom_firmware_version_minor") + "." + env.GetProjectOption("custom_firmware_version_revision") + ".bin").replace('\\', '/')
# print(old_name)
# print(new_name)
# try:
# shutil.copy(old_name, new_name)
# except WindowsError:
# os.remove(new_name)
# os.rename(old_name, new_name)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。