fix(core): 修复一些情况下板卡无法进入waiting for download模式
This commit is contained in:
@@ -110,7 +110,11 @@ class Transport {
|
|||||||
|
|
||||||
async setRTS(state) {
|
async setRTS(state) {
|
||||||
await this.serial.setRTS(state);
|
await this.serial.setRTS(state);
|
||||||
if (this.tracing) this.trace(`Set RTS = ${state}`);
|
await this.serial.setDTR(this.serial.getDTR());
|
||||||
|
if (this.tracing) {
|
||||||
|
this.trace(`Set RTS = ${state}`);
|
||||||
|
this.trace(`Set DTR = ${this.serial.getDTR()}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async setDTR(state) {
|
async setDTR(state) {
|
||||||
|
|||||||
@@ -224,11 +224,23 @@ class WebSerialPort extends Serial {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setDTR(dtr) {
|
async setDTR(dtr) {
|
||||||
return this.setDTRAndRTS(dtr, this.getRTS());
|
if (!this.isOpened()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.#serialport_.setSignals({
|
||||||
|
dataTerminalReady: dtr
|
||||||
|
});
|
||||||
|
super.setDTR(dtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setRTS(rts) {
|
async setRTS(rts) {
|
||||||
return this.setDTRAndRTS(this.getDTR(), rts);
|
if (!this.isOpened()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.#serialport_.setSignals({
|
||||||
|
requestToSend: rts
|
||||||
|
});
|
||||||
|
super.setRTS(rts);
|
||||||
}
|
}
|
||||||
|
|
||||||
getVID() {
|
getVID() {
|
||||||
|
|||||||
Reference in New Issue
Block a user