在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 那个小箭头就可以自动上传固件,不再需要手工按按钮。