Merge pull request #36 from pkendall64/allow-connected-transport
Allow specifying the initial 'rom-baudrate' in constructor
This commit is contained in:
commit
5d7cda0bc3
@ -48,10 +48,11 @@ class ESPLoader {
|
|||||||
|
|
||||||
DETECTED_FLASH_SIZES = {0x12: '256KB', 0x13: '512KB', 0x14: '1MB', 0x15: '2MB', 0x16: '4MB', 0x17: '8MB', 0x18: '16MB'};
|
DETECTED_FLASH_SIZES = {0x12: '256KB', 0x13: '512KB', 0x14: '1MB', 0x15: '2MB', 0x16: '4MB', 0x17: '8MB', 0x18: '16MB'};
|
||||||
|
|
||||||
constructor(transport, baudrate, terminal) {
|
constructor(transport, baudrate, terminal, rom_baudrate = 115200) {
|
||||||
this.transport = transport;
|
this.transport = transport;
|
||||||
this.baudrate = baudrate;
|
this.baudrate = baudrate;
|
||||||
this.terminal = terminal;
|
this.terminal = terminal;
|
||||||
|
this.rom_baudrate = rom_baudrate;
|
||||||
this.IS_STUB = false;
|
this.IS_STUB = false;
|
||||||
this.chip = null;
|
this.chip = null;
|
||||||
|
|
||||||
@ -280,7 +281,7 @@ class ESPLoader {
|
|||||||
var resp;
|
var resp;
|
||||||
this.chip = null;
|
this.chip = null;
|
||||||
this.write_char('Connecting...');
|
this.write_char('Connecting...');
|
||||||
await this.transport.connect();
|
await this.transport.connect({baud:this.rom_baudrate});
|
||||||
for (i = 0 ; i < attempts; i++) {
|
for (i = 0 ; i < attempts; i++) {
|
||||||
resp = await this._connect_attempt({mode:mode, esp32r0_delay:false});
|
resp = await this._connect_attempt({mode:mode, esp32r0_delay:false});
|
||||||
if (resp === "success") {
|
if (resp === "success") {
|
||||||
|
Loading…
Reference in New Issue
Block a user