Fix: 修复部分linux系统下setDTRAndRTS报错
This commit is contained in:
@@ -455,11 +455,15 @@ class StatusBarSerial extends PageBase {
|
|||||||
async open() {
|
async open() {
|
||||||
await this.#serial_.open(this.#config_.baud);
|
await this.#serial_.open(this.#config_.baud);
|
||||||
await this.#serial_.sleep(200);
|
await this.#serial_.sleep(200);
|
||||||
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
|
try {
|
||||||
|
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
|
||||||
|
} catch (error) {
|
||||||
|
Debug.error(error);
|
||||||
|
}
|
||||||
if (SELECTED_BOARD?.serial?.ctrlCBtn) {
|
if (SELECTED_BOARD?.serial?.ctrlCBtn) {
|
||||||
await this.#serial_.sleep(500);
|
await this.#serial_.sleep(500);
|
||||||
await this.#serial_.interrupt();
|
await this.#serial_.interrupt();
|
||||||
await this.#serial_.sleep(1000);
|
await this.#serial_.sleep(500);
|
||||||
this.#valueTemp_ = '';
|
this.#valueTemp_ = '';
|
||||||
this.empty();
|
this.empty();
|
||||||
this.startRead();
|
this.startRead();
|
||||||
@@ -479,7 +483,11 @@ class StatusBarSerial extends PageBase {
|
|||||||
} else {
|
} else {
|
||||||
await this.#serial_.open();
|
await this.#serial_.open();
|
||||||
await this.#serial_.sleep(200);
|
await this.#serial_.sleep(200);
|
||||||
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
|
try {
|
||||||
|
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
|
||||||
|
} catch (error) {
|
||||||
|
Debug.error(error);
|
||||||
|
}
|
||||||
this.startRead();
|
this.startRead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user