File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ tools.esptool.upload.params.quiet=
149149# First, potentially perform an erase or nothing
150150# Next, do the binary upload
151151# Combined in one rule because Arduino doesn't suport upload.1.pattern/upload.3.pattern
152- tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} "{build.path}/{build.project_name}.bin"
152+ tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} write_flash 0x0 "{build.path}/{build.project_name}.bin"
153153
154154tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
155155
Original file line number Diff line number Diff line change 3939 # https://github.com/esp8266/Arduino/issues/6755#issuecomment-553208688
4040 if thisarg == "erase_flash" :
4141 write_option = '--erase-all'
42- thisarg = ''
43-
44- if thisarg == 'erase_region' :
42+ elif thisarg == 'erase_region' :
4543 erase_addr = sys .argv .pop (0 )
4644 erase_len = sys .argv .pop (0 )
47- thisarg = ''
48-
49- # Backwards compatibility with fs upload tools, eat --end
50- if thisarg == '--end' :
51- thisarg = ''
52-
53- # Backwards compatibility with fs upload tools, parse write_flash for later use
54- if thisarg == 'write_flash' :
45+ elif thisarg == '--end' :
46+ # Backwards compatibility with fs upload tools, eat --end
47+ pass
48+ elif thisarg == 'write_flash' :
5549 write_addr = sys .argv .pop (0 )
5650 binary = sys .argv .pop (0 )
57- thisarg = ''
58-
59- if os .path .isfile (thisarg ):
60- binary = thisarg
61- thisarg = ''
62-
63- if len (thisarg ):
51+ elif len (thisarg ):
6452 cmdline = cmdline + [thisarg ]
6553
6654cmdline = cmdline + ['write_flash' ]
7058
7159erase_file = ''
7260if len (erase_addr ):
73- # generate temporary empty (0xff) file
61+ # Generate temporary empty (0xff) file
7462 eraser = tempfile .mkstemp ()
7563 erase_file = eraser [1 ]
7664 os .write (eraser [0 ], bytearray ([255 ] * int (erase_len , 0 )))
You can’t perform that action at this time.
0 commit comments