在platformio自动上传esp8266固件

不想每次上传固件的时候手工点按钮,修改这个文件:C:\Users\你的登录名.platformio\platforms\espressif8266\builder\main.py

在319行UPLOADERFLAGS=中间增加2行:

elif upload_protocol == "esptool":
env.Replace(
UPLOADER=join(
platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"),
UPLOADERFLAGS=[
"--chip", "esp8266",
"--port", '"$UPLOAD_PORT"',
"--before", "default_reset",
"--after", "hard_reset",
"--baud", "$UPLOAD_SPEED",
"write_flash"
],
UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS 0x0 $SOURCE'
)

最终实现的效果就是,只要点击PlatformIO:upload 那个小箭头就可以自动上传固件,不再需要手工按按钮。

posted on 2022-09-29 22:45  kitesong  阅读(132)  评论(0编辑  收藏  举报

导航