1 Star 0 Fork 0

chen_zac/PlatformIO_AIR32F103CBT6_Bootloader

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add_nanolib.py 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
chen_zac 提交于 2023-07-19 14:37 . 0719第一次提交
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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen_zac/platform-io_-air32-f103-cbt6_-bootloader.git
git@gitee.com:chen_zac/platform-io_-air32-f103-cbt6_-bootloader.git
chen_zac
platform-io_-air32-f103-cbt6_-bootloader
PlatformIO_AIR32F103CBT6_Bootloader
bootloader

搜索帮助