mirror of
https://github.com/esphome/esphome-flasher.git
synced 2024-11-25 12:25:47 +01:00
Faster upload (4x)
This commit is contained in:
parent
ad12b28132
commit
fbb3b5c6e4
@ -22,6 +22,8 @@ def parse_args(argv):
|
||||
group = parser.add_mutually_exclusive_group(required=False)
|
||||
group.add_argument('--esp8266', action='store_true')
|
||||
group.add_argument('--esp32', action='store_true')
|
||||
group.add_argument('--upload-baud-rate', type=int, default=460800,
|
||||
help="Baud rate to upload with (not for logging)")
|
||||
parser.add_argument('--bootloader',
|
||||
help="(ESP32-only) The bootloader to flash.",
|
||||
default=ESP32_DEFAULT_BOOTLOADER_FORMAT)
|
||||
@ -110,6 +112,12 @@ def run_esphomeflasher(argv):
|
||||
|
||||
stub_chip = chip_run_stub(chip)
|
||||
|
||||
if args.upload_baud_rate != 115200:
|
||||
try:
|
||||
stub_chip.change_baud(args.upload_baud_rate)
|
||||
except esptool.FatalError as err:
|
||||
raise EsphomeflasherError("Error changing ESP upload baud rate: {}".format(err))
|
||||
|
||||
flash_size = detect_flash_size(stub_chip)
|
||||
print(" - Flash Size: {}".format(flash_size))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user